Skip to main content

flatmate

Your Friendly Data Flattener. Convert Nested JSON from an API into a List of Single-Depth Dictionaries for Writing to a CSV.

install

pip install flatmate

basic usage

# in JSON-compatible format
data = {
  "agency": "GSA",
  "measurementType": {
    "method": "modules"
  },
  "version": "2.0.0",
  "releases": [
    {
      "name": "usasearch",
      "description": "System now maintained in open repo https://github.com/GSA/search-gov.",
      "permissions": {
        "licenses": None,
        "usageType": "governmentWideReuse"
      },
      "tags": [
        "GSA"
      ]
    },
    # ...
  ]
}
from flatmate import flatten

# flatten data into a list of flat single-depth dictionaries
flatten(data, start="releases")
[
  {
    "releases.name": "usasearch",
    "releases.description": "System now maintained in open repo https://github.com/GSA/search-gov.",
    "releases.permissions.licenses": "null",
    "releases.permissions.usageType": "governmentWideReuse",
    "releases.tags": "GSA",
    # ...
  },
  # ...
]

advanced usage

coming soon

Metadata

Release files for flatmate 0.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flatmate 0.0.0
File Size Uploaded Provenance Actions
flatmate-0.0.0.tar.gz 5.6 kB Without provenance Details for flatmate-0.0.0.tar.gz

Release files / flatmate-0.0.0.tar.gz

Download URL flatmate-0.0.0.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1d7aa665f788273d53500ee2160ee1c08b82ec9a7f81cd3934c9551af0be67cf
BLAKE2b-256 checksum
How to use checksums
991dfd2bbe4384f380aa18ef0202428020acd604f95f654ba945b8d1a9298f8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.0

Security for flatmate 0.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page