The `public` library for Python, version 2020.12.3, provides a `@public` decorator to explicitly mark functions, classes, and variables as part of a module's public API. It automatically manages and replaces the module's `__all__` list, aiming to simplify explicit module visibility control. The library appears to be in maintenance mode, with its last release in late 2020.
pip install publicVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to use the `@public` decorator for functions and how to alias them. It also illustrates that non-decorated functions remain private and cannot be imported.
Avoid manually defining `__all__` in modules where `public` is used, or be mindful that `public` will manage it. Ensure all desired public symbols are decorated.
To expose a variable `my_var`, either use `@public('my_var')` on a dummy function (e.g., `def _pass(): pass`) or explicitly call `public.add(my_var=my_var)` in your module's top-level scope.Factor project status into your dependency choices; consider alternatives for new projects requiring active development or modern Python features.
Decorate `your_private_func` with `@public` in `your_module.py` if it should be public, or refrain from importing it.
For variables, use `@public('variable_name')` on a dummy `def _pass(): pass` or explicitly call `public.add(variable_name=your_variable)`. Ensure `@public` is used correctly as a decorator for functions/classes.Ensure the variable `my_variable` is defined at the module level and that the `public.add` mechanism (either via decorator or direct call) is correctly implemented and executes during module import.
No dependency data recorded yet.