{"id":1578,"library":"namex","title":"Namex: Python API Surface Management","description":"Namex is a Python utility that helps package developers define and manage their public API surface, primarily by simplifying the construction of the `__all__` attribute in `__init__.py`. It prevents accidental exposure of internal details and ensures a consistent public interface. The current version is 0.1.0, and it is likely to see active development with potential for API evolution.","status":"active","version":"0.1.0","language":"python","source_language":"en","source_url":"https://github.com/namex-project/namex","tags":["api-management","package-development","utility","__all__"],"install":[{"cmd":"pip install namex","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"wrong":"from namex import Config","symbol":"convert","correct":"from namex import convert"},{"symbol":"export","correct":"from namex import export"},{"symbol":"generate","correct":"from namex import generate"}],"quickstart":{"code":"# my_package/__init__.py\nfrom namex import Config, get_api\n\nconfig = Config(\n    modules=[\"my_package.module_a\", \"my_package.module_b\"],\n    excludes=[\"my_package.module_a.private_func\"]\n)\n__all__ = get_api(config)\n\n# my_package/module_a.py\ndef public_func_a():\n    pass\ndef _private_func_a(): # Excluded by convention\n    pass\ndef private_func(x): # Explicitly excluded\n    pass\n\n# my_package/module_b.py\nclass PublicClassB:\n    pass\n","lang":"python","description":"This example demonstrates how to set up `namex` in a package's `__init__.py` to define its public API. It imports `Config` and `get_api`, then configures which modules to scan and which specific symbols to exclude. The resulting `__all__` ensures only specified public members are exposed."},"warnings":[{"fix":"Consult the latest documentation and release notes for updates when upgrading. Pin your version for production environments.","message":"As an early-stage library (v0.1.0), the public API of `namex` is subject to rapid evolution. Breaking changes may occur in minor releases until a stable API is established (e.g., v1.0.0).","severity":"gotcha","affected_versions":"0.1.x"},{"fix":"Thoroughly review the generated `__all__` content and adhere strictly to naming conventions and explicit configuration rules within your package.","message":"Namex relies on conventions (e.g., leading underscores for private members) and explicit configuration (e.g., `excludes`). Misunderstandings of these conventions can lead to unintended API exposure or hidden public components.","severity":"gotcha","affected_versions":"0.1.0"},{"fix":"Use Namex as the sole authority for managing your package's `__all__` attribute within its scope to ensure consistent and predictable API definition.","message":"Mixing Namex with manual `__all__` management or other API surface management tools within the same package can lead to unpredictable behavior and difficult-to-debug import errors.","severity":"gotcha","affected_versions":"0.1.0"}],"env_vars":null,"search_vec":"'0.1.0':51 'accident':36 'activ':58 'api':3,20,63,66 'api-manag':65 'attribut':30 'consist':44 'construct':26 'current':48 'defin':15 'detail':40 'develop':14,59,70 'ensur':42 'evolut':64 'exposur':37 'help':12 'init':32 'interfac':46 'intern':39 'like':55 'manag':5,17,67 'namex':1,6 'packag':13,69 'package-develop':68 'potenti':61 'prevent':35 'primarili':22 'public':19,45 'py':33 'python':2,9 'see':57 'simplifi':24 'surfac':4,21 'util':10,71 'version':49","created_at":"2026-04-09T03:54:09.309871+00:00","updated_at":"2026-04-16T17:18:57.784760+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.1.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":"https://pypi.org/project/namex/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-30","last_verified":"2026-08-27","next_check":"2026-07-30","install_tag":null}}