OpenDataServices / flatten-tool

Tools for generating CSV and other flat versions of the structured data
http://flatten-tool.readthedocs.io/en/latest/
MIT License
101 stars 18 forks source link

Flatten-Tool [Beta]

Build Status Coverage Status Code Health License: MIT Documentation Status

Flatten-Tool is a general purpose tool with the goal of allowing a dataset to be round-tripped between structured JSON and tabular data packages or spreadsheets: providing a bridge between richly structured datasets and accessible flat formats.

It was developed for use with the Open Contracting Data Standard, and has been further developed with the 360 Giving Data Standard. We're keen to see if it is useful in other contexts too.

It is also used in to power the COnvert Validate Explore (COVE) tool which provides a web interface for Flatten-Tool configured against a particular JSON Schema.

For more information see the Flatten-Tool docs.

Features

For more information see the Flatten-Tool docs.

Quick Example

For more examples see http://flatten-tool.readthedocs.io/en/latest/examples/

{
    "main": [
        {
            "id": "1",
            "a": [
                {
                    "b": "2",
                    "c": "3"
                },
                {
                    "b": "4",
                    "c": "5"
                }
            ],
            "d": "6"
        },
        {
            "id": "7",
            "a": [
                {
                    "b": "8",
                    "c": "9"
                },
                {
                    "b": "10",
                    "c": "11"
                }
            ],
            "d": "12"
        }
    ]
}

Can be converted to/from these spreadsheets:

id d
1 6
7 12
id a/0/b a/0/c
1 2 3
1 4 5
7 8 9
7 10 11

For more examples see http://flatten-tool.readthedocs.io/en/latest/examples/