Skip to main content

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

Project description

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[]]`)

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

subdicts-1.0.3.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

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

subdicts-1.0.3-py2.7.egg (5.1 kB view details)

Uploaded Egg

File details

Details for the file subdicts-1.0.3.tar.gz.

File metadata

  • Download URL: subdicts-1.0.3.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for subdicts-1.0.3.tar.gz
Algorithm Hash digest
SHA256 a3e194f36ede356fa662745e67e0ae990452095b7d684b1ba547ffa1381076c0
MD5 ba45973161d4823b38af7b30a8b5aaef
BLAKE2b-256 f1dc9bf0f1fefdf8f54b9968f3fa6fd8be10e5a0143504aa98d4a7fe39f0199a

See more details on using hashes here.

File details

Details for the file subdicts-1.0.3-py2.7.egg.

File metadata

  • Download URL: subdicts-1.0.3-py2.7.egg
  • Upload date:
  • Size: 5.1 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for subdicts-1.0.3-py2.7.egg
Algorithm Hash digest
SHA256 0ca9f85baf782aeece5d62003e88185da8149be81884d44bb7712ba74684b784
MD5 7e5b1809df53db813576ab20b969e7d0
BLAKE2b-256 52171cffabc7cc99efcedd867370fd836aeb09f71d110bf1b1dfca43f2434a59

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