Skip to main content
subdicts
========

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

####Installation

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:

```
[subdicts]
recipe = zc.recipe.egg
eggs = subdicts
```

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

####Usage

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'}}
```

####Contributing

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

```
$ git clone git@github.com:arnellebalane/subdicts.git
$ 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.

####Todo

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

Release files for subdicts 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for subdicts 1.0.3
File Size Uploaded
subdicts-1.0.3.tar.gz 2.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for subdicts 1.0.3
File Interpreter ABI Platform
subdicts-1.0.3-py2.7.egg Legacy Egg format - - Details

Total release size: 7.8 kB

Release files / subdicts-1.0.3.tar.gz

Download URL subdicts-1.0.3.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a3e194f36ede356fa662745e67e0ae990452095b7d684b1ba547ffa1381076c0
BLAKE2b-256 checksum
How to use checksums
f1dc9bf0f1fefdf8f54b9968f3fa6fd8be10e5a0143504aa98d4a7fe39f0199a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / subdicts-1.0.3-py2.7.egg

Download URL subdicts-1.0.3-py2.7.egg
Size 5.1 kB
Tags Egg
SHA-256 checksum
How to use checksums
0ca9f85baf782aeece5d62003e88185da8149be81884d44bb7712ba74684b784
BLAKE2b-256 checksum
How to use checksums
52171cffabc7cc99efcedd867370fd836aeb09f71d110bf1b1dfca43f2434a59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.2

2 release files

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page