# 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.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']
```
Raw data
{
"_id": null,
"home_page": "https://github.com/tombulled/export",
"name": "export",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "python,export,public,private",
"author": "Tom Bulled",
"author_email": "26026015+tombulled@users.noreply.github.com",
"download_url": "https://files.pythonhosted.org/packages/9c/4e/6e9b2a1594d00b138ea8f51007ad73ab646c42f4694b12a0395576d9b9f8/export-0.2.1.tar.gz",
"platform": null,
"description": "# export\nControl module exports\n\n## About\nThis library dynamically generates an `__all__` attribute for modules\n\n## Install\n```console\npip install export\n```\n\n## Usage\n\n### Private by Default\n*Does* export objects marked **public**, *doesn't* export everything else\n\n```python\n# lib.py\n\nimport export\n\nexport.init(default=export.PRIVATE)\n\n@export.public\ndef foo():\n pass\n\ndef bar():\n pass\n\ndef baz():\n pass\n```\n\n```python\n>>> import lib\n>>> \n>>> lib.__all__\n['foo']\n```\n\n### Public by Default\n*Doesn't* export objects marked **private**, *does* export everything else\n\n```python\n# lib.py\n\nimport export\n\nexport.init(default=export.PUBLIC)\n\ndef foo():\n pass\n\n@export.private\ndef bar():\n pass\n\n@export.private\ndef baz():\n pass\n```\n\n```python\n>>> import lib\n>>> \n>>> lib.__all__\n['export', 'foo']\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Control module exports",
"version": "0.2.1",
"project_urls": {
"Documentation": "https://github.com/tombulled/export",
"Homepage": "https://github.com/tombulled/export",
"Repository": "https://github.com/tombulled/export"
},
"split_keywords": [
"python",
"export",
"public",
"private"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5b7d1712bd54b282d4e0bef5a7dd08a1211609311c9cfefca979c7123d9eaed1",
"md5": "aaaeabeec745470a8eccd2debf9f8fda",
"sha256": "223ea74ae90715f56c3009e4cf19c8289b92ab56a3a0a8a00c5cf31e464f58f7"
},
"downloads": -1,
"filename": "export-0.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "aaaeabeec745470a8eccd2debf9f8fda",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 4120,
"upload_time": "2023-06-18T17:55:58",
"upload_time_iso_8601": "2023-06-18T17:55:58.500660Z",
"url": "https://files.pythonhosted.org/packages/5b/7d/1712bd54b282d4e0bef5a7dd08a1211609311c9cfefca979c7123d9eaed1/export-0.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9c4e6e9b2a1594d00b138ea8f51007ad73ab646c42f4694b12a0395576d9b9f8",
"md5": "689a66c8dc648afc4e1f23d1cba7e14c",
"sha256": "b206d7c6cb2246781321bc30394bf1364496fdfc1d1ea69cfe67da6d67095a7e"
},
"downloads": -1,
"filename": "export-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "689a66c8dc648afc4e1f23d1cba7e14c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 3052,
"upload_time": "2023-06-18T17:56:00",
"upload_time_iso_8601": "2023-06-18T17:56:00.024840Z",
"url": "https://files.pythonhosted.org/packages/9c/4e/6e9b2a1594d00b138ea8f51007ad73ab646c42f4694b12a0395576d9b9f8/export-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-18 17:56:00",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tombulled",
"github_project": "export",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "export"
}