--- id: clabe version: "2.1.11" license: unclear license_treatment: permissive maintenance: active --- # clabe — Validate and generate the control digit of a CLABE in Mexico License: permissive · Maintenance: active · Downloads: 138.3K/mo ## What it is and what it does clabe is a Python library for working with CLABE numbers, Mexico's standardized bank account identifiers used in the SPEI payment system. It provides validation, control digit computation, bank name lookup from the bank code, and generation of new valid CLABE numbers. The package integrates directly with pydantic as a custom type, allowing you to use CLABE as a validated field in pydantic models with automatic error reporting for invalid bank codes or malformed numbers. The library maintains an internal registry of Mexican bank codes and names, with tooling to detect and track changes against the official Banxico participant list. As of version 2.0.0, the package requires pydantic v2 and drops support for earlier versions. You can add or remove banks programmatically, though the maintainers recommend keeping the official bank list synchronized via pull requests rather than runtime modifications. Use it for: - Validate CLABE account numbers in financial transaction forms or APIs before processing payments. - Use CLABE as a pydantic field type to automatically validate bank account input in data models. - Look up the bank name from a bank code for display or reconciliation purposes. - Generate test CLABE numbers for unit tests or sandbox environments. - Compute the correct control digit for a partial CLABE to verify or reconstruct account identifiers. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Validates and generates CLABE numbers, Mexico's standard bank account identifier, with built-in bank code lookup and Pydantic integration. Yes. The package is actively maintained, has no security vulnerabilities, installs with minimal friction (one lightweight dependency), and directly solves a specific problem for anyone working with Mexican banking data. The pydantic integration is particularly valuable if you're already using pydantic for data validation. ## Install pip install clabe uv add clabe poetry add clabe ## Installing clabe Before you install: Low friction: pure Python wheel with only pydantic as a runtime dependency. Actively maintained with a commit as recent as 2026-08-05 and no known vulnerabilities. License in practice: MIT license (permissive) means you can use, modify, and distribute this package freely in commercial or private projects with minimal restrictions. Quickstart: pip install clabe from clabe import Clabe from pydantic import BaseModel class Account(BaseModel): clabe: Clabe account = Account(clabe='723010123456789019') print(account.clabe) Requires Python 3.8 or higher. Verify before relying: - Whether the bank registry is kept in sync with official Banxico SPEI participant list in practice. - Performance characteristics when validating large batches of CLABE numbers. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 138.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags CLABE validation Mexico, bank account number validator, CLABE generator control digit, Mexican banking identifier, Pydantic CLABE type, SPEI participant lookup, banking, mexico, validation [View on SkillFed](https://skillfed.io/packages/clabe) · [View on PyPI](https://pypi.org/project/clabe/)