Skip to content

Thread-safe, lightweight and persistent dict for Python with a magical touch.

License

Notifications You must be signed in to change notification settings

KingKevin23/magic-container

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Magic Container

Thread-safe, lightweight and persistent dict for Python with a magical touch.

Contents

Installation:

pip install magic-container

Examples:

Use it like a dict:

from container import container

container["key"] = 3
print(container["key"])
del container["key"]

Or get the values while setting them if there aren't in the container:

from container import container

print(container.get("second_key", lambda: 23))

Limitations:

  1. Currently only works if installed and used in a virtual environment with write access to the venv folder.
  2. Currently keys can only be strings.
  3. Currently only the get, set and delete methods are defined.

About

Thread-safe, lightweight and persistent dict for Python with a magical touch.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages