rj-jesus / flatdict

Python module for interacting with nested dicts as a single level dict with delimited keys.

Home Page:http://flatdict.readthedocs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FlatDict

Version Downloads Status Coverage License

FlatDict is a dict object that allows for single level, delimited key/value pair mapping of nested dictionaries. You can interact with FlatDict like a normal dictionary and access child dicts as you normally would or with the composited key.

For example:

is represented as:

And can still be accessed as:

and

Additionally, lists and tuples are also converted into dicts using enumerate().

For example:

Will be flattened as follows:

API

FlatDict has the same methods as dict in Python 2.6. In addition, it has a FlatDict.as_dict method which will return a pure nested dictionary from a FlatDict value.

Documentation is available at http://flatdict.readthedocs.org

Installation

Example Use

About

Python module for interacting with nested dicts as a single level dict with delimited keys.

http://flatdict.readthedocs.org

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 100.0%