Skip to main content

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

Project description

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

Changelog

0.2.1 (2025-10-19)

  • Move msgspec to optional dependencies (it has some big issues on 3.14). It’s not really optional but perhaps a fork may work better on 3.14.

0.2.0 (2025-10-13)

  • Replace siruta.extras.LOCALITIES_BY_NAME with siruta.extras.LOCALITIES_BY_COUNTY_ID_BY_NAME (to avoid name collisions).

0.1.1 (2025-10-10)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_siruta-0.2.1.tar.gz (547.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_siruta-0.2.1-py3-none-any.whl (244.1 kB view details)

Uploaded Python 3

File details

Details for the file django_siruta-0.2.1.tar.gz.

File metadata

  • Download URL: django_siruta-0.2.1.tar.gz
  • Upload date:
  • Size: 547.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for django_siruta-0.2.1.tar.gz
Algorithm Hash digest
SHA256 29b6b047d210d71e55026aa31ee65e4a659ce9e54cf0d67b4e2a1c90e75d49f1
MD5 212de7853d32963dc335fd65e024b6ec
BLAKE2b-256 6656ee511ba725478a77b4a88ce266a3bec1d1750bda6290465e4c1d43b39279

See more details on using hashes here.

File details

Details for the file django_siruta-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: django_siruta-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 244.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for django_siruta-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9c46d1b1deb079cc317d03c21b95b99b7b5ef7e6742a00ed47845792d46e07dd
MD5 3aa894392b3e265c1676203f2cd5c6e5
BLAKE2b-256 098e6c8a9365c5bd10d7f6445f5d4f66b77530e9207dbf61f02a26054032a5e9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page