Easy headers, inspired by the tidy data specification.
Project description
tidy_headers
tidy_headers stores metadata in beautifully readable plain text headers.
example
For some filepath,
import collections
import tidy_headers
meta = collections.OrderedDict()
meta['date'] = '2017-11-10'
meta['location'] = 'Madison, Wisconsin, USA'
meta['name'] = ['batch', 'apples', 'pineapple', 'oregano', 'tomatoes']
tidy_headers.write(filepath, meta)
To get the dictionary back, simply read:
meta = tidy_headers.read(filepath)
:tada:
See the examples directory for more:
installation
using pip
pip install tidy_headers
using conda
conda config --add channels conda-forge
conda install tidy_headers
allowed values
tidy_headers strives to write plain text headers in an unambiguous way such that an identical metadata dictionary can be generated using read. This process is only reliable for the following subset of python types:
strintfloatlistcontaining any combination of the abovenumpy.ndarray(arbitrary size and dimensionality)
Metadata dictionaries containing only these types are guaranteed to read and write succesfully.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tidy_headers-1.0.4.tar.gz.
File metadata
- Download URL: tidy_headers-1.0.4.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f65fe7d50717640be9a89900e5ef100020cb725dd49abf62545e176a4dca2991
|
|
| MD5 |
802b6c45eb3210fb8539710e2e5ca520
|
|
| BLAKE2b-256 |
9de13d004bb9b4dfaa402c1539d4bf8a9e5b27b0dc89d66bb4668037c4c18e45
|
File details
Details for the file tidy_headers-1.0.4-py3-none-any.whl.
File metadata
- Download URL: tidy_headers-1.0.4-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94b5c6e53303498a781643aa6fcea4a82a5ebbcc015810cbffb9f98f8f570ffe
|
|
| MD5 |
16058039eae9b91b3d87e3a6724906fa
|
|
| BLAKE2b-256 |
1645dcbb4c036d0e2dccae498cb3f6277f04835adf9ae17fa01c766e173cfb44
|