Skip to main content

Dictionary that automatically adds children dictionaries as necessary

Project description

AutoDict

Unit Test Pylint Coverage Badge

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

AutoDict-0.1.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

AutoDict-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file AutoDict-0.1.0.tar.gz.

File metadata

  • Download URL: AutoDict-0.1.0.tar.gz
  • Upload date:
  • Size: 6.3 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

Hashes for AutoDict-0.1.0.tar.gz
Algorithm Hash digest
SHA256 44ad82db4bda98a04ed9706af6190afc9a367b1d2cabe4549b5ddc52c2159a6b
MD5 839d75e660f4109ed753a9541ec3d897
BLAKE2b-256 caddf4c0d73bd5fe23140cffef3483ba132efa14afb19a9bc0f797f8098f834e

See more details on using hashes here.

File details

Details for the file AutoDict-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: AutoDict-0.1.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

Hashes for AutoDict-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3f69a47e66ac79fe3ce626d3b4f86eb676ad83e280dd0176fbf61cad4f5d7a8c
MD5 22dd428317f3889c3e1e39e7df733e2d
BLAKE2b-256 6cf4404c2beb0ad0e5e53f1c63be9bed7769ab000a76a6380ee825188cb724e0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page