Public vs Internal API¶
The Boundary¶
libtmux draws a clear line between public and internal code:
Import path |
Status |
Stability |
|---|---|---|
|
Public |
Covered by deprecation policy |
|
Internal |
No guarantee — may break between any release |
|
Vendored |
Not part of the API at all |
If you can import it without a leading underscore in the module path, it’s public.
Why the Split¶
Internal modules exist so the library can iterate freely on implementation details without breaking downstream users. A refactor of libtmux._internal.query_list doesn’t require a deprecation cycle — it’s explicitly not part of the contract.
This separation also keeps the public API surface intentionally small. Every public module is a commitment to maintain. Internal modules earn promotion through proven stability and user demand.
What _internal/ Contains¶
The _internal package holds implementation details that support the public API:
query_list— the filtering engine behind.filter()and.get()on collectionsdataclasses— base dataclass utilities used by the ORM objectsconstants— internal constants not meaningful to end userstypes— type aliases used across the codebase
These are documented in Internals for contributors, but downstream projects should not import from them.
What _vendor/ Contains¶
The _vendor package holds vendored third-party code — copies of external libraries included directly to avoid adding dependencies. This code is not written by the libtmux authors and is not part of the API.
How Internal APIs Get Promoted¶
Internal: lives in
_internal/, no stability promiseExperimental: documented, usable, but explicitly marked as subject to change
Public: moved to a top-level module, covered by the deprecation policy
Promotion happens when an internal API proves stable across multiple releases and users request it. If you depend on an internal API, file an issue — that signal helps prioritize promotion.
Reference¶
Public API — the authoritative list of what’s stable
Compatibility — platform and version support
Deprecations — what’s changing