{"id":23872,"library":"id-phonenumbers","title":"id-phonenumbers","description":"Indonesian phone number parser and validator, based on Google's libphonenumber. Current version 0.4.0, with occasional releases. Parses, formats, and validates Indonesian mobile and fixed-line numbers, including area codes and operator prefixes.","status":"active","version":"0.4.0","language":"python","source_language":"en","source_url":"https://github.com/SeiryuZ/id_phonenumbers","tags":["indonesia","phone","number","validation","libphonenumber"],"install":[{"cmd":"pip install id-phonenumbers","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"The correct package is id_phonenumbers, not the generic phonenumbers library.","wrong":"from phonenumbers import PhoneNumber","symbol":"PhoneNumber","correct":"from id_phonenumbers import PhoneNumber"},{"note":"Same as above – use the id_phonenumbers module.","wrong":"from phonenumbers import parse","symbol":"parse","correct":"from id_phonenumbers import parse"},{"note":"Import from id_phonenumbers, not phonenumbers.","wrong":"from phonenumbers import is_valid_number","symbol":"is_valid_number","correct":"from id_phonenumbers import is_valid_number"},{"note":"Use the id_phonenumbers namespace.","wrong":"from phonenumbers import format_number","symbol":"format_number","correct":"from id_phonenumbers import format_number"},{"note":"","wrong":null,"symbol":"PhoneNumberFormat","correct":"from id_phonenumbers import PhoneNumberFormat"}],"quickstart":{"code":"from id_phonenumbers import parse, is_valid_number, format_number, PhoneNumberFormat\n\nnumber = '+6281234567890'\nparsed = parse(number, 'ID')\nprint('Valid:', is_valid_number(parsed))\nprint('Formatted:', format_number(parsed, PhoneNumberFormat.INTERNATIONAL))","lang":"python","description":"Parse, validate, and format an Indonesian phone number."},"warnings":[{"fix":"Use `from id_phonenumbers import ...` in your code.","message":"The import module is named `id_phonenumbers` (underscore, not hyphen). Many users mistakenly use `id-phonenumbers` as import name, which is invalid.","severity":"gotcha","affected_versions":"all"},{"fix":"Always pass `region='ID'` or `region=None` if number includes country code but better to be explicit.","message":"The parse function requires the second argument `region='ID'` to ensure Indonesian number parsing. Omitting it may lead to incorrect parsing for numbers without country code.","severity":"gotcha","affected_versions":"all"},{"fix":"Downgrade to Python 3.11 or use a virtual environment. Watch for updates.","message":"Version 0.4.0 does not yet support Python 3.12+ officially (check setup.py). Using with Python 3.12+ may cause import errors due to removed APIs.","severity":"deprecated","affected_versions":"0.4.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install id-phonenumbers` and import as `id_phonenumbers`.","cause":"Installed the wrong package (id-phonenumbers vs phonenumbers).","error":"ModuleNotFoundError: No module named 'phonenumbers'"},{"fix":"Use `from id_phonenumbers import parse`.","cause":"Incorrect import: using `import id_phonenumbers` then calling `id_phonenumbers.parse` but `parse` is a function directly in the module.","error":"AttributeError: module 'id_phonenumbers' has no attribute 'parse'"},{"fix":"Use 'ID' as region code, and import PhoneNumberFormat if needed: `from id_phonenumbers import PhoneNumberFormat`.","cause":"Passed an invalid region code or forgot to import PhoneNumberFormat constants.","error":"KeyError: 'ID'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}