You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
1.4 KiB
Plaintext
84 lines
1.4 KiB
Plaintext
2 years ago
|
Metadata-Version: 2.1
|
||
|
Name: export
|
||
|
Version: 0.2.0
|
||
|
Summary: Control module exports
|
||
|
Home-page: https://github.com/tombulled/export
|
||
|
License: MIT
|
||
|
Keywords: python,export,public,private
|
||
|
Author: Tom Bulled
|
||
|
Author-email: 26026015+tombulled@users.noreply.github.com
|
||
|
Requires-Python: >=3.8,<4.0
|
||
|
Classifier: License :: OSI Approved :: MIT License
|
||
|
Classifier: Programming Language :: Python :: 3
|
||
|
Classifier: Programming Language :: Python :: 3.10
|
||
|
Classifier: Programming Language :: Python :: 3.8
|
||
|
Classifier: Programming Language :: Python :: 3.9
|
||
|
Project-URL: Documentation, https://github.com/tombulled/export
|
||
|
Project-URL: Repository, https://github.com/tombulled/export
|
||
|
Description-Content-Type: text/markdown
|
||
|
|
||
|
# export
|
||
|
Control module exports
|
||
|
|
||
|
## About
|
||
|
This library dynamically generates an `__all__` attribute for modules
|
||
|
|
||
|
## Usage
|
||
|
|
||
|
### Private by Default
|
||
|
*Does* export objects marked **public**, *doesn't* export everything else
|
||
|
|
||
|
```python
|
||
|
# lib.py
|
||
|
|
||
|
import export
|
||
|
|
||
|
export.init(default=export.PRIVATE)
|
||
|
|
||
|
@export.public
|
||
|
def foo():
|
||
|
pass
|
||
|
|
||
|
def bar():
|
||
|
pass
|
||
|
|
||
|
def baz():
|
||
|
pass
|
||
|
```
|
||
|
|
||
|
```python
|
||
|
>>> import lib
|
||
|
>>>
|
||
|
>>> lib.__all__
|
||
|
['foo']
|
||
|
```
|
||
|
|
||
|
### Public by Default
|
||
|
*Doesn't* export objects marked **private**, *does* export everything else
|
||
|
|
||
|
```python
|
||
|
# lib.py
|
||
|
|
||
|
import 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']
|
||
|
```
|