Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tombulled/export
Expose module functionality
https://github.com/tombulled/export
export python
Last synced: 23 days ago
JSON representation
Expose module functionality
- Host: GitHub
- URL: https://github.com/tombulled/export
- Owner: tombulled
- License: mit
- Created: 2021-10-11T12:40:55.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-18T17:52:42.000Z (over 1 year ago)
- Last Synced: 2023-11-20T11:43:01.866Z (about 1 year ago)
- Topics: export, python
- Language: Python
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# export
Control module exports## About
This library dynamically generates an `__all__` attribute for modules## Install
```console
pip install export
```## Usage
### Private by Default
*Does* export objects marked **public**, *doesn't* export everything else```python
# lib.pyimport export
export.init(default=export.PRIVATE)
@export.public
def foo():
passdef bar():
passdef baz():
pass
``````python
>>> import lib
>>>
>>> lib.__all__
['foo']
```### Public by Default
*Doesn't* export objects marked **private**, *does* export everything else```python
# lib.pyimport export
export.init(default=export.PUBLIC)
def foo():
pass@export.private
def bar():
pass@export.private
def baz():
pass
``````python
>>> import lib
>>>
>>> lib.__all__
['export', 'foo']
```