Skip to main content

Convert relational data to tree-like structure (JSON)

Project description

rel2tree

Convert relational data to tree-like structure like JSON. Aggregate, filter your data, make custom computation.

What is this?

Let's suppose you run a business where clients can hold money and can have approved credits in diffrent currencies. You may want to generate a /balance api endpoint that outputs the following result:

  {
    "balances": [
      {
        "clientID": 111,
        "available": [
          {
            "currencyID": "EUR",
            "amount": 125
          }
        ],
        "credit": [
          {
            "currencyID": "EUR",
            "amount": 50
          }
        ],
        "currencies": [
          "EUR"
        ]
      },
      {
        "clientID": 333,
        "available": [
          {
            "currencyID": "EUR",
            "amount": 123
          },
          {
            "currencyID": "GBP",
            "amount": 200
          }
        ],
        "credit": [],
        "currencies": [
          "EUR",
          "GBP"
        ]
      }
    ],
    "clientDetails": [
      {
        "clientID": 222,
        "clientCode": "00222"
      },
      {
        "clientID": 111,
        "clientCode": "00111"
      }
    ]
  }

Install

pip install rel2tree

Usage

TODO

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
rel2tree-5.0.0.tar.gz (2.6 kB) Copy SHA256 hash SHA256 Source None

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