Skip to main content

Python 3 implementation of Flatdata

Project description

flatdata-py

Build Status

Python 3 implementation of flatdata.

Running the tests

python3 -m pytest

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.10.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flatdata_py-0.4.10-py2.py3-none-any.whl (18.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file flatdata_py-0.4.10.tar.gz.

File metadata

  • Download URL: flatdata_py-0.4.10.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.3","id":"zena","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for flatdata_py-0.4.10.tar.gz
Algorithm Hash digest
SHA256 1bb34108fb27538fb5ac1b3884cb330c7ec195ad2f803de175dd429694039db0
MD5 8a10727e56458c1510793981cdeeb6b9
BLAKE2b-256 f04a665029e29b242cb9289f359338f43ec953ddca860d4554532d338b27b9f2

See more details on using hashes here.

File details

Details for the file flatdata_py-0.4.10-py2.py3-none-any.whl.

File metadata

  • Download URL: flatdata_py-0.4.10-py2.py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.3","id":"zena","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for flatdata_py-0.4.10-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 22718ec35692a678d12517d499e6edcd7d2da1cd7e35c35a87986014e1a49173
MD5 a5e97dfac0cba9b31c0f8b3adb1e170c
BLAKE2b-256 11757ae7cad9be33545e61dcf3b3e34e0d739354fbf26cce89fc4261a36b45b0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page