Skip to main content

brazilian-ids

A Python 3 package that provides functions and classes to validate several Brazilian IDs.

Documentation

Current supported IDs:

  • CNPJ
  • Numeração única de processo judicial
  • CEP
  • Município
  • CPF
  • PIS/PASEP
  • CNO
  • SQL

See the module documentation for details.

Extended CEP validation

brazilian_ids.functions.location.extended_cep validates a CEP against its actual registered state and neighborhood by querying the ViaCEP API, instead of relying only on the static per-state ranges used by the core cep module. It requires the extended-cep extra:

pip install brazilian-ids[extended-cep]

Development

There are no external dependencies to just use the module, with the exception of the optional extended_cep module (see above).

Development dependencies are managed with uv and declared in the dev group of pyproject.toml. See also the Makefile file.

To do

  • Create documentation at readthedocs website.
  • Refactor tests to use parametrized fixtures
  • Benchmark algorithms to pad IDs

References

This project borrows code and ideas from the following open source projects:

See also:

Download files

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

Source Distribution

brazilian_ids-0.4.0.tar.gz (117.9 kB view details)

Uploaded Source

Built Distribution

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

brazilian_ids-0.4.0-py3-none-any.whl (46.9 kB view details)

Uploaded Python 3

File details

Details for the file brazilian_ids-0.4.0.tar.gz.

File metadata

  • Download URL: brazilian_ids-0.4.0.tar.gz
  • Upload date:
  • Size: 117.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for brazilian_ids-0.4.0.tar.gz
Algorithm Hash digest
SHA256 e0d4d773960d0f785fce3737e66603d270449a104ae2344a36cc96cceabae2a2
MD5 2bb6815cf1dadfc99c20472634650a7f
BLAKE2b-256 ac77347041fc60cd05ca0597d3228aef985cd75b1aa6221407d832c9f4824c28

See more details on using hashes here.

File details

Details for the file brazilian_ids-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: brazilian_ids-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 46.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for brazilian_ids-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b85248fd3b75a78012c31c924df98eed5951c6ee17644b5c705431e23420caf1
MD5 53653193db79e4ca5fa49ad82d1f01ed
BLAKE2b-256 7401d3194683e511eb853e2461adf1682978944fcda4c6655344e56855cca9da

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page