Dictionary that automatically adds children dictionaries as necessary
Project description
AutoDict
Dictionary that automatically adds children dictionaries as necessary. Including a json based serialization and deserialization.
Environment
List of dependencies for package to run.
Required
- None
Optional
- None
Installation / Build / Deployment
Install module
> python -m pip install .
For development, install as a link to repository such that code changes are used.
> python -m pip install -e .
Usage
import autodict import AutoDict, JSONAutoDict
d = AutoDict()
d["level0"]["level1"]["level2"]["level3"]["level4"] = "value"
print(d)
## TODO
with JSONAutoDict("autodict.json") as j:
j["level0"]["level1"]["level2"]["level3"]["level4"] = "value"
with open("autodict.json") as f:
print(f.read())
## TODO
with JSONAutoDict("autodict.json") as j:
j["level0"]["key"] = "another value"
with open("autodict.json") as f:
print(f.read())
## TODO
Running Tests
To run the automated tests, execute unittest discover
:
> python -m unittest discover tests -v
To run the automated tests with coverage, execute coverage run
:
> python -m coverage run
> python -m coverage report
Development
Code development of this project adheres to Google Python Guide
Styling
Use yapf
to format files, based on Google's guide with the exception of indents being 2 spaces.
Versioning
Versioning of this projects adheres to Semantic Versioning and is implemented using git tags.
Project details
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 AutoDict-1.0.0.tar.gz
.
File metadata
- Download URL: AutoDict-1.0.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e534b0ce1be62a4fdff25e54892dfe005bc19643ffd72e69fe5da7839eb8d7f |
|
MD5 | 9b1fc724e278bd151772531a63e774cf |
|
BLAKE2b-256 | e90ba4a67e77fbbe27e02a9570feb76bbb7ebeb024ff046b60b3459b07548dc8 |
File details
Details for the file AutoDict-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: AutoDict-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db07c5ebdb00dcf95d674cff223f7b7edbcbe4b2dbb5c3e4694fe07a4a2a60e5 |
|
MD5 | ff39abfc38a1ef6837df001135e3dce2 |
|
BLAKE2b-256 | b3324ec4ca0a3d079503acd9a0cbaa1877f6bdc56eea937b9fbef0a60e28d9db |