Skip to main content

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:

  • str
  • int
  • float
  • list containing any combination of the above
  • numpy.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.

Files for tidy_headers, version 1.0.3
Filename, size File type Python version Upload date Hashes
Filename, size tidy_headers-1.0.3-py3-none-any.whl (7.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size tidy_headers-1.0.3.tar.gz (7.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page