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

Make flat dict and back from dict

Project description

Accordion

Build Status Coverage Status PyPI version

About

Make flat dict and back from dict

Installation

With pip:

pip install accordion

Example

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

Requirements

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
  • ./run_tests.sh

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 accordion, version 0.2.3
Filename, size File type Python version Upload date Hashes
Filename, size accordion-0.2.3.tar.gz (3.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