Skip to content

jeff-hykin/simple_namespace

Repository files navigation

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) 

About

💾 ⭐️

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published