# tidy_headers
`tidy_headers` stores metadata in beautifully readable plain text headers.
## example
For some `filepath`,
```python
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`:
```python
meta = tidy_headers.read(filepath)
```
:tada:
See the examples directory for more:
* [minimal.txt](../master/examples/minimal.txt)
* [named.txt](../master/examples/named.txt)
## 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.
Raw data
{
"_id": null,
"home_page": "https://github.com/untzag/tidy_headers",
"name": "tidy_headers",
"maintainer": null,
"docs_url": null,
"requires_python": ">3.8",
"maintainer_email": null,
"keywords": null,
"author": "Blaise Thompson",
"author_email": "blaise@untzag.com",
"download_url": "https://files.pythonhosted.org/packages/9d/e1/3d004bb9b4dfaa402c1539d4bf8a9e5b27b0dc89d66bb4668037c4c18e45/tidy_headers-1.0.4.tar.gz",
"platform": null,
"description": "# tidy_headers\n\n`tidy_headers` stores metadata in beautifully readable plain text headers.\n\n## example\n\nFor some `filepath`, \n\n```python\nimport collections\nimport tidy_headers\nmeta = collections.OrderedDict()\nmeta['date'] = '2017-11-10'\nmeta['location'] = 'Madison, Wisconsin, USA'\nmeta['name'] = ['batch', 'apples', 'pineapple', 'oregano', 'tomatoes']\ntidy_headers.write(filepath, meta)\n```\n\nTo get the dictionary back, simply `read`:\n\n```python\nmeta = tidy_headers.read(filepath)\n```\n\n:tada:\n\nSee the examples directory for more:\n* [minimal.txt](../master/examples/minimal.txt)\n* [named.txt](../master/examples/named.txt)\n\n## installation\n\n### using pip\n\n```\npip install tidy_headers\n```\n\n### using conda\n\n```\nconda config --add channels conda-forge\nconda install tidy_headers\n```\n\n## allowed values\n\n`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:\n\n- `str`\n- `int`\n- `float`\n- `list` containing any combination of the above\n- `numpy.ndarray` (arbitrary size and dimensionality)\n\nMetadata dictionaries containing only these types are guaranteed to `read` and `write` succesfully.\n",
"bugtrack_url": null,
"license": null,
"summary": "Easy headers, inspired by the tidy data specification.",
"version": "1.0.4",
"project_urls": {
"Homepage": "https://github.com/untzag/tidy_headers"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "1645dcbb4c036d0e2dccae498cb3f6277f04835adf9ae17fa01c766e173cfb44",
"md5": "16058039eae9b91b3d87e3a6724906fa",
"sha256": "94b5c6e53303498a781643aa6fcea4a82a5ebbcc015810cbffb9f98f8f570ffe"
},
"downloads": -1,
"filename": "tidy_headers-1.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "16058039eae9b91b3d87e3a6724906fa",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">3.8",
"size": 7461,
"upload_time": "2024-10-20T22:52:47",
"upload_time_iso_8601": "2024-10-20T22:52:47.656289Z",
"url": "https://files.pythonhosted.org/packages/16/45/dcbb4c036d0e2dccae498cb3f6277f04835adf9ae17fa01c766e173cfb44/tidy_headers-1.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "9de13d004bb9b4dfaa402c1539d4bf8a9e5b27b0dc89d66bb4668037c4c18e45",
"md5": "802b6c45eb3210fb8539710e2e5ca520",
"sha256": "f65fe7d50717640be9a89900e5ef100020cb725dd49abf62545e176a4dca2991"
},
"downloads": -1,
"filename": "tidy_headers-1.0.4.tar.gz",
"has_sig": false,
"md5_digest": "802b6c45eb3210fb8539710e2e5ca520",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">3.8",
"size": 7950,
"upload_time": "2024-10-20T22:52:49",
"upload_time_iso_8601": "2024-10-20T22:52:49.863362Z",
"url": "https://files.pythonhosted.org/packages/9d/e1/3d004bb9b4dfaa402c1539d4bf8a9e5b27b0dc89d66bb4668037c4c18e45/tidy_headers-1.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-20 22:52:49",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "untzag",
"github_project": "tidy_headers",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "tidy_headers"
}