Skip to main content

Python 3 implementation of Flatdata

Project description

flatdata-py

Build Status

Python 3 implementation of flatdata.

Basic usage

Once you have created a flatdata schema file, you can generate a Python module to read your existing flatdata archive:

flatdata-generator --gen py --schema locations.flatdata --output-file locations.py

Using the inspector

flatdata-py comes with a handy tool called the flatdata-inspector to inspect the contents of an archive:

  • from the flatdata-py source directory:
./inspector.py
# or
python3 -m flatdata.lib.inspector
  • if you want to install flatdata-py:
pip3 install flatdata-py[inspector]  # the inspector feature requires IPython
flatdata-inspector -p /path/to/my/flatdata.archive

Using the writer

flatdata-writer is an addition to flatdata-py that can create flatdata archives from a flatdata schema, with the following limitations:

  • does not allow adding additional sub-archives to an existing archive

  • supports only bulk-writing (no streaming)

  • not optimized for performance

  • from the flatdata-py source directory

./writer.py --schema archive.flatdata --output-dir testdir --json-file data.json --resource-name resourcename
#or
python3 -m flatdata.lib.writer --schema archive.flatdata --output-dir testdir --json-file data.json --resource-name resourcename

Note that the flatdata-writer CLI tool can only write one resource at a time. For archives that have multiple non-optional resources, the tool has to be executed separately for each resource. Only after all resources have been written can the archive be opened.

  • if you want to install flatdata-py:
pip3 install flatdata-py[writer]
flatdata-writer --schema archive.flatdata --output-dir testdir --json-file data.json --resource-name resourcename

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

flatdata-py-0.4.4.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

flatdata_py-0.4.4-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file flatdata-py-0.4.4.tar.gz.

File metadata

  • Download URL: flatdata-py-0.4.4.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.10

File hashes

Hashes for flatdata-py-0.4.4.tar.gz
Algorithm Hash digest
SHA256 44977a636688ddbb5557d1a109f75322e25cd9311166b52195cda122ab078c8e
MD5 3f41a79477399d59da56e3c3a7b47bcf
BLAKE2b-256 4a259d6c6fdd8dfbece84b0b5d78276fa216c2e3aed972d621c879ca7a5c52b7

See more details on using hashes here.

File details

Details for the file flatdata_py-0.4.4-py3-none-any.whl.

File metadata

  • Download URL: flatdata_py-0.4.4-py3-none-any.whl
  • Upload date:
  • Size: 17.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.10

File hashes

Hashes for flatdata_py-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 cef726485dc8e8b09b7ed0272a9efad28b93678cd06bca7394fd525991c0ad0a
MD5 a2e12a2a18d0ad2c445991042a8de01b
BLAKE2b-256 643b59fd207f484eddc293a70044f96ef3e5a3d8f76d4eaa1cb52b54ded4c012

See more details on using hashes here.

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