{"id":21043,"library":"clabe","title":"clabe","description":"Validate and generate the control digit of a CLABE (Clave Bancaria Estandarizada) in Mexico. Current version: 2.1.10, requires Python >=3.8. Active development with monthly releases.","status":"active","version":"2.1.10","language":"python","source_language":"en","source_url":"https://github.com/cuenca-mx/clabe-python","tags":["mexico","clabe","banking","validation","control digit"],"install":[{"cmd":"pip install clabe","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"","wrong":"","symbol":"clabe","correct":"from clabe import clabe"},{"note":"","wrong":"","symbol":"BankConfigRequest","correct":"from clabe import BankConfigRequest"}],"quickstart":{"code":"from clabe import clabe\n\n# Validate a CLABE\nresult = clabe('032180000118359719')\nprint(result.valid)  # True or False\n\n# Generate the control digit\nclabe_number = '03218000011835971'\ndigit = clabe.generate_check_digit(clabe_number)\nprint(digit)  # e.g., 9\n\n# Get bank info\nbanks = clabe.get_banks()\nprint(banks[:2])","lang":"python","description":"Validate a CLABE string, generate a check digit, or fetch bank list."},"warnings":[{"fix":"Upgrade and use `from clabe import clabe` then call `clabe('...')` instead of `CLABE('...')`.","message":"In version 2.0.0, the API was rewritten. The old `CLABE` class is replaced by a simple function and module-level methods.","severity":"breaking","affected_versions":"<2.0.0"},{"fix":"Strip non-digit characters: `clabe('0321 8000 0118 3597 19')` fails; use `clabe('032180000118359719')`.","message":"The CLABE string must be exactly 18 digits. Passing digits with spaces or formatting will cause validation errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Always access dict keys safely with `.get()`, e.g., `bank.get('name')`.","message":"The `clabe.get_banks()` method returns a list of dicts, but the dict keys are not guaranteed to be consistent across versions.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run `pip install clabe` (not `pip install CLABE`).","cause":"Library not installed or installed under different name.","error":"ModuleNotFoundError: No module named 'clabe'"},{"fix":"Use `from clabe import clabe` and then call `clabe('...')`.","cause":"Old import pattern using `from clabe import CLABE`; API changed in v2.","error":"AttributeError: module 'clabe' has no attribute 'CLABE'"},{"fix":"Do not name your variable `clabe`. Use a different variable name like `my_clabe`.","cause":"Accidentally named a variable `clabe` before importing.","error":"TypeError: 'str' object is not callable"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}