Registry / devops / namex
library0.1.0pypypi✓ verified 24d ago

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.

pip install namex
INSTALL
IMPORT
SIG · NAMEX
N
namex
devopspythonv0.1.0
Install
1.6s avg
Import
10ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.010s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.010s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

convert
from namex import convert
from namex import Config
export
from namex import export
generate
from namex import generate

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.

# my_package/__init__.py from namex import Config, get_api config = Config( modules=["my_package.module_a", "my_package.module_b"], excludes=["my_package.module_a.private_func"] ) __all__ = get_api(config) # my_package/module_a.py def public_func_a(): pass def _private_func_a(): # Excluded by convention pass def private_func(x): # Explicitly excluded pass # my_package/module_b.py class PublicClassB: pass
Debug
Known issues
gotchaAs 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).
fix
Consult the latest documentation and release notes for updates when upgrading. Pin your version for production environments.
affects: 0.1.x
gotchaNamex 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.
fix
Thoroughly review the generated `__all__` content and adhere strictly to naming conventions and explicit configuration rules within your package.
affects: 0.1.0
gotchaMixing 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.
fix
Use Namex as the sole authority for managing your package's `__all__` attribute within its scope to ensure consistent and predictable API definition.
affects: 0.1.0
Upgrade
Version history
0.1.0latest on PyPI · released May 26, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
Resources
namex — pip install namex · libregistry