{"id":23085800,"url":"https://github.com/neurodatawithoutborders/ndx-labmetadata-example","last_synced_at":"2025-04-03T15:29:15.006Z","repository":{"id":87540904,"uuid":"540269258","full_name":"NeurodataWithoutBorders/ndx-labmetadata-example","owner":"NeurodataWithoutBorders","description":"Example extension to illustrate how to extend LabMetaData for adding lab-specific metadata","archived":false,"fork":false,"pushed_at":"2022-09-23T07:18:08.000Z","size":28,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":7,"default_branch":"dev","last_synced_at":"2025-02-09T04:22:49.167Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NeurodataWithoutBorders.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-23T03:50:44.000Z","updated_at":"2022-09-23T03:52:04.000Z","dependencies_parsed_at":"2023-12-01T12:45:56.942Z","dependency_job_id":null,"html_url":"https://github.com/NeurodataWithoutBorders/ndx-labmetadata-example","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeurodataWithoutBorders%2Fndx-labmetadata-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeurodataWithoutBorders%2Fndx-labmetadata-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeurodataWithoutBorders%2Fndx-labmetadata-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeurodataWithoutBorders%2Fndx-labmetadata-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NeurodataWithoutBorders","download_url":"https://codeload.github.com/NeurodataWithoutBorders/ndx-labmetadata-example/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247027280,"owners_count":20871509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-16T18:11:01.836Z","updated_at":"2025-04-03T15:29:14.968Z","avatar_url":"https://github.com/NeurodataWithoutBorders.png","language":"Python","readme":"# ndx-labmetadata-example Extension for NWB\n\nThis is an example extension to illustrate how to extend the ``LabMetaData`` type from NWB to add lab-specific metadata. This extension is **NOT** intended for use in practice but is intended only as an example to illustrate how to generate an NWB extension using the ``LabMetaData`` type.\n\n## Installation\n\n```\npip install .\n```\n\n## Usage\n\n```python\nfrom pynwb.file import NWBFile, Subject\nfrom ndx_labmetadata_example import LabMetaDataExtensionExample\nfrom pynwb import NWBHDF5IO\nfrom uuid import uuid4\nfrom datetime import datetime\n\n# create an example NWBFile\nnwbfile = NWBFile(\n    session_description=\"test session description\",\n    identifier=str(uuid4()),\n    session_start_time=datetime(1970, 1, 1),\n    subject=Subject(\n        age=\"P50D\",\n        description=\"example mouse\",\n        sex=\"F\",\n        subject_id=\"test_id\")\n)\n\n# create our custom lab metadata\nlab_meta_data = LabMetaDataExtensionExample(tissue_preparation=\"Example tissue preparation\")\n\n# Add the test LabMetaDataExtensionExample to the NWBFile\nnwbfile.add_lab_meta_data(lab_meta_data=lab_meta_data)\n\n# Write the file to disk\nfilename = 'testfile.nwb'\nwith NWBHDF5IO(path=filename, mode='a') as io:\n    io.write(nwbfile)\n\n# Read the file from disk\nwith NWBHDF5IO(path=filename, mode='r') as io:\n    in_nwbfile = io.read()\n    in_lab_meta_data = in_nwbfile.get_lab_meta_data(lab_meta_data.name)\n    assert lab_meta_data.tissue_preparation == in_lab_meta_data.tissue_preparation\n\n```\n\n---\nThis extension was created using [ndx-template](https://github.com/nwb-extensions/ndx-template).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneurodatawithoutborders%2Fndx-labmetadata-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneurodatawithoutborders%2Fndx-labmetadata-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneurodatawithoutborders%2Fndx-labmetadata-example/lists"}