# What is this?
This is a very simple python tool for creating namespaces. It tries to solve the problem that there is [no elegant way to create singleton classes](https://stackoverflow.com/questions/31875/is-there-a-simple-elegant-way-to-define-singletons) or nested namespaces in python.
# How do I use this?
`pip install simple_namespace`
```python
from simple_namespace import namespace
@namespace
def MyNamespace():
my_value = 10
def my_function(arg1):
return 99
return locals()
# prints 10
print(MyNamespace.my_value)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/jeff-hykin/simple_namespace",
"name": "simple-namespace",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "",
"author": "Jeff Hykin",
"author_email": "jeff.hykin@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/ea/f7/488729ab4ea72e9587e2dfb4a50599851b7394cde4112a1906d4020ab374/simple_namespace-1.0.0.tar.gz",
"platform": "",
"description": "# What is this?\n\nThis is a very simple python tool for creating namespaces. It tries to solve the problem that there is [no elegant way to create singleton classes](https://stackoverflow.com/questions/31875/is-there-a-simple-elegant-way-to-define-singletons) or nested namespaces in python.\n\n# How do I use this?\n\n`pip install simple_namespace`\n\n```python\nfrom simple_namespace import namespace\n\n@namespace\ndef MyNamespace():\n my_value = 10\n def my_function(arg1):\n return 99\n\n return locals()\n\n# prints 10\nprint(MyNamespace.my_value) \n```\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Organize code better with namespaces",
"version": "1.0.0",
"project_urls": {
"Homepage": "https://github.com/jeff-hykin/simple_namespace"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bcd56e19f6464e76ce710106aa222500c82198b0a74113ab96dd68285afd8fd2",
"md5": "db80dedd338567c545d884f0844318f2",
"sha256": "abbcb832ee44a6fbf4c0fa654388ad90d11297ab71b9d3d7bc4e2e882e57173f"
},
"downloads": -1,
"filename": "simple_namespace-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "db80dedd338567c545d884f0844318f2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 2275,
"upload_time": "2021-08-02T18:09:54",
"upload_time_iso_8601": "2021-08-02T18:09:54.121958Z",
"url": "https://files.pythonhosted.org/packages/bc/d5/6e19f6464e76ce710106aa222500c82198b0a74113ab96dd68285afd8fd2/simple_namespace-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "eaf7488729ab4ea72e9587e2dfb4a50599851b7394cde4112a1906d4020ab374",
"md5": "81ab862c12df741a3115ab70ec36beb8",
"sha256": "e7e2ff6900b9809822623674fc1e45b46f1188ee3fde46330c381500420f8e9e"
},
"downloads": -1,
"filename": "simple_namespace-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "81ab862c12df741a3115ab70ec36beb8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 1811,
"upload_time": "2021-08-02T18:09:55",
"upload_time_iso_8601": "2021-08-02T18:09:55.483598Z",
"url": "https://files.pythonhosted.org/packages/ea/f7/488729ab4ea72e9587e2dfb4a50599851b7394cde4112a1906d4020ab374/simple_namespace-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2021-08-02 18:09:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jeff-hykin",
"github_project": "simple_namespace",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "simple-namespace"
}