brazilnum
Validate Brazilian CNPJ, CEI, CPF, PIS/PASEP, CEP, and municipal numbers
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has zero known vulnerabilities, imposes no dependency overhead, and solves a specific domain problem well. Install it if you work with Brazilian identification numbers in production systems or data pipelines.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or newer.
- Low install friction with no runtime dependencies.
- Active maintenance: last release 21 days ago, repository shows ongoing development with 99 stars.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions; suitable for most projects.
last release 2026-07-24 (21 days) · last repo commit 2026-07-24 · 99 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 337,580 downloads/mo, #7,447 on PyPI
Alternatives
Verify before relying
pip install brazilnum
from brazilnum.cnpj import validate_cnpj
from brazilnum.cpf import validate_cpf
validate_cnpj('02.558.157/0001-62') # True
validate_cpf('968.811.342-58') # True- Whether alphanumeric CNPJ support (added in version 0.9.0) is production-ready or still experimental.
- Performance characteristics when validating large batches of identifiers.
What it is and what it does
Brazilnum is a validation and formatting library for Brazilian identification numbers used by individuals, businesses, and government systems. It handles CNPJ (corporate tax ID), CEI (business registration), CPF (individual tax ID), PIS/PASEP (social security), CEP (postal codes), and IBGE municipal codes. The library accepts both formatted strings and raw numeric input, auto-corrects missing leading zeros in integers, and treats missing values (None, NaN) as invalid rather than raising errors—useful for data pipelines with incomplete records.
Beyond validation, it provides formatting functions to display identifiers in standard Brazilian notation, parsing functions to extract components (firm ID, establishment number, check digits), and utilities to clean formatting. It recently added support for alphanumeric CNPJ format introduced in 2026. The package has no external dependencies and supports Python 3.9 through 3.14, making it lightweight for integration into larger systems.
Use it for
- Validate customer CNPJ or CPF during account registration or payment processing.
- Parse CNPJ to extract firm and establishment identifiers for business lookup.
- Format and clean Brazilian ID numbers from data imports or user input.
- Validate CEP postal codes when processing Brazilian shipping addresses.
- Batch-validate municipal codes from government or census data sources.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has zero known vulnerabilities, imposes no dependency overhead, and solves a specific domain problem well. Install it if you work with Brazilian identification numbers in production systems or data pipelines.
Install
brazilnum on PyPI
Before you install
Low install friction with no runtime dependencies. Active maintenance: last release 21 days ago, repository shows ongoing development with 99 stars.
Requires Python 3.9 or newer.
License in practice
MIT license permits commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install brazilnum
from brazilnum.cnpj import validate_cnpj
from brazilnum.cpf import validate_cpf
validate_cnpj('02.558.157/0001-62') # True
validate_cpf('968.811.342-58') # True
Verify before relying
- Whether alphanumeric CNPJ support (added in version 0.9.0) is production-ready or still experimental.
- Performance characteristics when validating large batches of identifiers.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 21 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 337,580 / month, #7,447 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Utilities |
Evidence: brazilnum-0.10.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “brazilian identification validation”
- brazilnumValidates and formats Brazilian identification numbers including…
- validate-docbrValidates and generates Brazilian identity and registration documents…
- BrazilFiscalReportConverts Brazilian electronic invoice XML files (NF-e, CT-e, MDF-e,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.
Install it if you need to display or transform source code.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
See also validate-docbr · python-stdnum · luhn · BrazilFiscalReport · django-phonenumber-field · django-phonenumbers · iso639-lang · sigfig · fastnumbers