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.

Source Distribution

tidy_headers-1.0.3.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

tidy_headers-1.0.3-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file tidy_headers-1.0.3.tar.gz.

File metadata

  • Download URL: tidy_headers-1.0.3.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.0

File hashes

Hashes for tidy_headers-1.0.3.tar.gz
Algorithm Hash digest
SHA256 82bd39752c9eb171708619c5affbcfd86a82bab801b42e167eba53812dc75c82
MD5 2322ed64775bf946fc3c65f8509df866
BLAKE2b-256 3cf9724ecb6ad4ead027a704801b257da1f9d22119ec495ab683156420caa5b1

See more details on using hashes here.

File details

Details for the file tidy_headers-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for tidy_headers-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8d9e7150b26ddfd51bbd7eee80d0dd024e633b8268e3785d2287e3664c7f6d3c
MD5 a236d613e0ffb2fc3ff3d096483c3919
BLAKE2b-256 449777caf43aa3f1770f59653ef2ddf349a6dc44f1889924cbafae910037eeff

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