Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

A small python utility which parses nested-keys in dictionaries into sub-dictionaries.

Project description


A small python utility which parses nested-keys in dictionaries into sub-dictionaries.


This package can be installed from PyPI using `pip`. Make sure you have `pip` installed
then run:

$ pip install subdicts

#####Installation Using Buildout

If you're using __Buildout__ and want to use __subdicts__ you can do so by adding the
following lines to your `buildout.cfg` file:

recipe = zc.recipe.egg
eggs = subdicts

and appending `subdicts` to your `buildout:parts`.


This package has one method, `subdicts.utils.parse`, which does the parsing.

from subdicts.utils import parse

dict = {'person[firstname]': 'arnelle', 'person[lastname]': 'balane'}
parsed = parse(dict)

# parsed = {'person': {'firstname': 'arnelle', 'lastname': 'balane'}}


To contribute to this mini-project just fork this repository, clone your forked repository
and run buildout inside the project directory.

$ git clone
$ cd subdicts
$ ./bin/buildout

This will take care of retrieving the project's dependencies.

When contributing new code to the project, please test your code. The test files are
located inside the `src/subdicts/tests` directory. To run the tests simply do:

$ ./bin/test

Merging your code into this main repository must be done through pull requests.

####Bugs and Issues

If you find any bugs and issues in this project, please report them by opening an
issue here.


- properly parse compicated dictionary keys, especially those containing inner `[` and
`]` characters (e.g. `person[name[]]`)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for subdicts, version 1.0.3
Filename, size File type Python version Upload date Hashes
Filename, size subdicts-1.0.3-py2.7.egg (5.1 kB) File type Egg Python version 2.7 Upload date Hashes View hashes
Filename, size subdicts-1.0.3.tar.gz (2.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page