Python 3 implementation of Flatdata
Project description
flatdata-py
Python 3 implementation of flatdata.
Running the tests
python3 -m nose
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
Built Distribution
File details
Details for the file flatdata-py-0.4.5.tar.gz
.
File metadata
- Download URL: flatdata-py-0.4.5.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6556f0df240cfab51ee41fef3fe8c24a6fda13b9e02b39b3b188ca720e48cb37 |
|
MD5 | 9a665d627b07462f9ac36e3602003b13 |
|
BLAKE2b-256 | 508136ba0f8944873d9cb28c0c276cf6f137947083e17b2e26fdb7bc83b5bbbd |
File details
Details for the file flatdata_py-0.4.5-py3-none-any.whl
.
File metadata
- Download URL: flatdata_py-0.4.5-py3-none-any.whl
- Upload date:
- Size: 19.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdad981764c7470d2752e861af922dd1cd72066c40cc42b071b2c06ddc517b16 |
|
MD5 | df3ea8b60cccaa0c9726d54e52e0cc37 |
|
BLAKE2b-256 | 08dc82c2a3d26d76b9b01f366b25688c8188665a073f24be1082346b24cdf5f6 |