# ndx-turner-metadata Extension for NWB
The NWB extension for storing Turner lab specific metadata.
Extends `pynwb.file.LabMetaData` to store the MPTP treatment status of the subject.
## Installation
```bash
pip install ndx_turner_metadata
```
## Usage
```python
from uuid import uuid4
from datetime import datetime
from dateutil.tz import tzlocal
from pynwb import NWBFile, NWBHDF5IO
from ndx_turner_metadata import TurnerLabMetaData
# Create NWBFile
nwbfile = NWBFile(
session_description="session_description",
identifier=str(uuid4()),
session_start_time=datetime(1970, 1, 1, tzinfo=tzlocal()),
)
# Create LabMetaData
lab_meta_data = TurnerLabMetaData(
name="MPTPMetaData",
MPTP_status="pre-MPTP",
)
# Add to NWBFile
nwbfile.add_lab_meta_data(lab_meta_data=lab_meta_data)
# Write LabMetaData to NWB file
nwbfile_path = "metadata.nwb"
with NWBHDF5IO(nwbfile_path, mode="w") as io:
io.write(nwbfile)
# Check LabMetaData was added to the NWB file
with NWBHDF5IO(nwbfile_path, mode="r", load_namespaces=True) as io:
read_nwbfile = io.read()
read_nwbfile_lab_metadata = read_nwbfile.lab_meta_data["MPTPMetaData"]
```
---
This extension was created using [ndx-template](https://github.com/nwb-extensions/ndx-template).
Raw data
{
"_id": null,
"home_page": "",
"name": "ndx-turner-metadata",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "NWB,NeurodataWithoutBorders,ndx-extension,nwb-extension",
"author": "",
"author_email": "Szonja Weigl <ben.dichter@catalystneuro.com>",
"download_url": "https://files.pythonhosted.org/packages/45/30/0f572f84e1aee25c3e2571ffe6d09aed34ce899ea6736794ee14c551c2d3/ndx_turner_metadata-0.1.0.tar.gz",
"platform": null,
"description": "# ndx-turner-metadata Extension for NWB\n\nThe NWB extension for storing Turner lab specific metadata.\n\nExtends `pynwb.file.LabMetaData` to store the MPTP treatment status of the subject.\n\n\n## Installation\n\n```bash\npip install ndx_turner_metadata\n```\n\n## Usage\n\n```python\nfrom uuid import uuid4\nfrom datetime import datetime\nfrom dateutil.tz import tzlocal\n\nfrom pynwb import NWBFile, NWBHDF5IO\n\nfrom ndx_turner_metadata import TurnerLabMetaData\n\n# Create NWBFile\nnwbfile = NWBFile(\n session_description=\"session_description\",\n identifier=str(uuid4()),\n session_start_time=datetime(1970, 1, 1, tzinfo=tzlocal()),\n )\n\n# Create LabMetaData\nlab_meta_data = TurnerLabMetaData(\n name=\"MPTPMetaData\",\n MPTP_status=\"pre-MPTP\",\n)\n\n# Add to NWBFile\nnwbfile.add_lab_meta_data(lab_meta_data=lab_meta_data)\n\n# Write LabMetaData to NWB file\nnwbfile_path = \"metadata.nwb\"\nwith NWBHDF5IO(nwbfile_path, mode=\"w\") as io:\n io.write(nwbfile)\n \n# Check LabMetaData was added to the NWB file\nwith NWBHDF5IO(nwbfile_path, mode=\"r\", load_namespaces=True) as io:\n read_nwbfile = io.read()\n read_nwbfile_lab_metadata = read_nwbfile.lab_meta_data[\"MPTPMetaData\"]\n\n```\n\n---\nThis extension was created using [ndx-template](https://github.com/nwb-extensions/ndx-template).\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "The NWB extension for storing Turner lab specific metadata",
"version": "0.1.0",
"project_urls": null,
"split_keywords": [
"nwb",
"neurodatawithoutborders",
"ndx-extension",
"nwb-extension"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "279151309c61365755bd90ba5864eb9c8f0bb28e2894e088085ce6de3a5f9889",
"md5": "c2c06181e31db4e9301b1351ea13bbf1",
"sha256": "19091e7f7d96e9f95041d507fbe370941fd9242c1bb47e91074f09d997cfe7b5"
},
"downloads": -1,
"filename": "ndx_turner_metadata-0.1.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "c2c06181e31db4e9301b1351ea13bbf1",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 4062,
"upload_time": "2024-03-06T13:42:20",
"upload_time_iso_8601": "2024-03-06T13:42:20.115833Z",
"url": "https://files.pythonhosted.org/packages/27/91/51309c61365755bd90ba5864eb9c8f0bb28e2894e088085ce6de3a5f9889/ndx_turner_metadata-0.1.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "45300f572f84e1aee25c3e2571ffe6d09aed34ce899ea6736794ee14c551c2d3",
"md5": "73f24360d9a0bce5d6bbae36d926549d",
"sha256": "913bc0a3e928040654cf6d542bdfd68540bf2fd719b3a201003735b27fbd6d6b"
},
"downloads": -1,
"filename": "ndx_turner_metadata-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "73f24360d9a0bce5d6bbae36d926549d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12162,
"upload_time": "2024-03-06T13:42:21",
"upload_time_iso_8601": "2024-03-06T13:42:21.455287Z",
"url": "https://files.pythonhosted.org/packages/45/30/0f572f84e1aee25c3e2571ffe6d09aed34ce899ea6736794ee14c551c2d3/ndx_turner_metadata-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-06 13:42:21",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "ndx-turner-metadata"
}