Skip to main content

Dotty dict-like object allow to access deeply nested keys using dot notation.

Project description

dotty_dict

https://img.shields.io/pypi/v/dotty_dict.svg https://img.shields.io/travis/pawelzny/dotty_dict.svg Documentation Status Updates

Dotty dictionary with support_for[‘dot.notation.keys’].

Dotty dict-like object allow to access deeply nested keys using dot notation. Create Dotty from dict or other dict-like object to use magic of Dotty.

Ultimate goal is to match all Python dictionary method to work with deeply nested Dotty keys.

Features

  • Access and assign deeply nested dictionary key using dot notation

  • Return None if key doesn’t exist instead of KeyError exception

  • Get deeply nested value or default value with .get() method

TODO

  • Escape dot char for dictionary keys with dot: dotty_dict[‘key.key’]

  • Delete deeply nested keys: del dotty_dict[‘key.key’]

  • Check if key exists in deeply nested dictionary: key.key.key in dotty_dict

  • Check if key does not exist in deeply nested dictionary: deeply.nested not in dotty_dict

  • Pop nested key: pop( key.key.key[, default] )

  • Set default bug fix

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.9 (2017-05-06)

Changed

  • __getitem__ will call __missing__ method if key does not exist

Added

  • __missing__ method which returns None

  • full documentation of dotty_dict usage

0.1.8 (2017-05-03)

Changed

  • Travis YAML configuration compatible with TOX

0.1.0 (2017-05-03)

Added

  • First release on PyPI.

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

dotty_dict-0.1.9.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dotty_dict-0.1.9-py2.py3-none-any.whl (5.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file dotty_dict-0.1.9.tar.gz.

File metadata

  • Download URL: dotty_dict-0.1.9.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dotty_dict-0.1.9.tar.gz
Algorithm Hash digest
SHA256 35045e484fc9bb66fc2eb18c2db6f0a58ff9627f36c14361bfc0607f7d3af12f
MD5 1bff388a6497569cb99bf98e48cff887
BLAKE2b-256 db0fd5b10ae67ca08dc02bc7b764dbff7caa16579abc31c6a7cd1af5fb210f91

See more details on using hashes here.

File details

Details for the file dotty_dict-0.1.9-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for dotty_dict-0.1.9-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 877bd27728761d8913dddb6cba20122b9025f284bc0d7b45070827ae85924adb
MD5 565ee10acc59172190b5afcab9725577
BLAKE2b-256 2701c5e14a775ca0c9a6f7818c313aa02b4c5a146e6c6f85842ce627dc920f7a

See more details on using hashes here.

Supported by

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