Organize code better with namespaces
Project description
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 or nested namespaces in python.
How do I use this?
pip install simple_namespace
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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file simple_namespace-1.0.0.tar.gz
.
File metadata
- Download URL: simple_namespace-1.0.0.tar.gz
- Upload date:
- Size: 1.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7e2ff6900b9809822623674fc1e45b46f1188ee3fde46330c381500420f8e9e |
|
MD5 | 81ab862c12df741a3115ab70ec36beb8 |
|
BLAKE2b-256 | eaf7488729ab4ea72e9587e2dfb4a50599851b7394cde4112a1906d4020ab374 |
File details
Details for the file simple_namespace-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: simple_namespace-1.0.0-py3-none-any.whl
- Upload date:
- Size: 2.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | abbcb832ee44a6fbf4c0fa654388ad90d11297ab71b9d3d7bc4e2e882e57173f |
|
MD5 | db80dedd338567c545d884f0844318f2 |
|
BLAKE2b-256 | bcd56e19f6464e76ce710106aa222500c82198b0a74113ab96dd68285afd8fd2 |