Skip to main content

Make flat dict and back from dict

Project description


Build Status Coverage Status PyPI version


Make flat dict and back from dict


With pip:

pip install accordion


from accordion import compress, expand

data = {
    "a": [1, 2, 3],
    "b": {
        "c": "d"

expected = {
    "a/0": 1,
    "a/1": 2,
    "a/2": 3,
    "b.c": "d"

assert compress(data) == expected
assert expand(compress(data)) == data


Tested with python3.6

Contribution how-to

Run tests:
  • clone repo: git clone <your-fork>
  • create and activate your virtualenv
  • pip install -r requirements.txt && pip install -r dev-requirements
  • ./

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

accordion-0.2.3.tar.gz (3.7 kB view hashes)

Uploaded source

Supported by

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