publication
Publication helps you maintain public-api-friendly modules by preventing unintentional access to private implementation details via introspection.
Decision gist · record as of 2026-08-14
Yes, if you are authoring a library and want to enforce a clean public API without underscore-prefixing all internal code. No, if you need active maintenance or modern Python tooling support—the package has been dormant since 2019 and may have compatibility issues with recent Python versions and type checkers. Consider it for stable, mature libraries where the one-time setup cost is justified; avoid it for new projects requiring ongoing support.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low install friction with no runtime dependencies.
- The package is dormant since January 2019 with no recent maintenance; it works with both Python 2 and 3 but has not been actively developed for several years.
License · maintenance · safety
permissive license (permissive) — Licensed under MIT (permissive), so you can use, modify, and distribute it freely with minimal restrictions.
last release 2019-01-15 (2768 days) · last repo commit 2024-02-05 · 43 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 8,276,943 downloads/mo, #1,639 on PyPI
Alternatives
Verify before relying
# In your module
from publication import publish
def public_function():
pass
def _private_function():
pass
__all__ = ['public_function']
publish()
# Internal code can access private details via module._private- Whether the package works correctly with Python versions released after 2019
- Compatibility with modern introspection tools and type checkers beyond the basic Mypy guidance in the description
- Whether the _private pseudo-module approach works reliably with all import patterns and edge cases
What it is and what it does
Publication is a runtime module namespace filter that enforces a library's declared public API by hiding everything not listed in `__all__`. It solves the problem that Python developers typically discover a module's interface by exploring it interactively (via `dir()`, tab-completion, or IDE auto-import) rather than reading documentation, leading to accidental dependencies on private implementation details and imports that library authors never intended to support.
The package works by intercepting module access and removing non-public names from the runtime namespace while preserving them in a `_private` pseudo-module for legitimate internal use (tests, type-checking, inter-module access). This lets library authors write code naturally without underscore-prefixing everything, while still making the public surface clear to exploratory users. It requires only a single `publish()` call at the end of your module.
Use it for
- Prevent users from accidentally importing internal helper functions or re-exported dependencies when exploring your library interactively
- Maintain a clean public API surface without resorting to underscore-prefixing all internal code and modules
- Allow internal tests and modules to access private implementation details via the `_private` namespace while keeping them hidden from external users
- Align library author expectations (documented public API) with user discovery patterns (interactive exploration)
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are authoring a library and want to enforce a clean public API without underscore-prefixing all internal code.
No, if you need active maintenance or modern Python tooling support—the package has been dormant since 2019 and may have compatibility issues with recent Python versions and type checkers. Consider it for stable, mature libraries where the one-time setup cost is justified; avoid it for new projects requiring ongoing support.
Install
publication on PyPI
Before you install
Low install friction with no runtime dependencies. The package is dormant since January 2019 with no recent maintenance; it works with both Python 2 and 3 but has not been actively developed for several years.
License in practice
Licensed under MIT (permissive), so you can use, modify, and distribute it freely with minimal restrictions.
Quickstart
# In your module
from publication import publish
def public_function():
pass
def _private_function():
pass
__all__ = ['public_function']
publish()
# Internal code can access private details via module._private
Verify before relying
- Whether the package works correctly with Python versions released after 2019
- Compatibility with modern introspection tools and type checkers beyond the basic Mypy guidance in the description
- Whether the _private pseudo-module approach works reliably with all import patterns and edge cases
Package facts
| License | permissive license permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Dormant 2,768 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 8,276,943 / month, #1,639 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 3 |
Evidence: publication-0.0.3-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “hide private implementation details”
- publicationPublication hides private implementation details and imports from a…
- sphinx-togglebuttonA Sphinx extension that adds collapsible toggle buttons to…
- atpublicProvides @public and @private decorators to document module…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also atpublic · public · apipkg · xmod · cursor · azure-synapse-managedprivateendpoints · stdlibs · docspec-python · pyseccomp