Overview

docs

Documentation Status

tests

GitHub Actions Build Status Coverage Status Coverage Status

package

PyPI Package latest release PyPI Wheel Supported versions Supported implementations Commits since latest release

A bunch of form fields and utilities for Romanian counties and localities using SIRUTA codes.

  • Free software: BSD 2-Clause License

Data:

Localities: https://data.gov.ro/dataset/activity/siruta-2024

Counties: https://data.gov.ro/dataset/activity/siruta

Form fields are designed to pass around integers (assuming you will have the most compact storage).

Form widgets use selectize. JS/CSS not bundled or included in media - you are free to load those however you like.

Installation

pip install django-siruta

You can also install the in-development version with:

pip install https://github.com/ionelmc/django-siruta/archive/main.zip

Documentation

Add siruta to your INSTALLED_APPS and use something like this:

class DemoForm(forms.Form):
    county = CountyField(label="Delivery county")
    locality = LocalityField(label="Delivery locality")

    billing_county = CountyField()
    billing_locality = LocalityField(county_field="billing_county")

With bootstrap5 would look like this:

https://github.com/ionelmc/django-siruta/blob/main/docs/example.png?raw=true

Complete code: https://github.com/ionelmc/django-siruta/blob/main/tests/testproject/views.py

Sphinx docs: https://django-siruta.readthedocs.io/

Development

To run all the tests run:

tox

Note, to combine the coverage data from all the tox environments run:

Windows

set PYTEST_ADDOPTS=--cov-append
tox

Other

PYTEST_ADDOPTS=--cov-append tox