{"id":19958015,"url":"https://github.com/echemdb/unitpackage","last_synced_at":"2026-01-16T17:45:53.996Z","repository":{"id":163254008,"uuid":"637997870","full_name":"echemdb/unitpackage","owner":"echemdb","description":"A Python library to interact with a collection of frictionless datapackages","archived":false,"fork":false,"pushed_at":"2025-05-03T05:52:07.000Z","size":6871,"stargazers_count":4,"open_issues_count":19,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-03T06:26:13.942Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://echemdb.github.io/unitpackage/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/echemdb.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2023-05-08T21:37:16.000Z","updated_at":"2025-05-03T05:52:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"58373b42-a90f-421a-9cc0-8ed8e041370b","html_url":"https://github.com/echemdb/unitpackage","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echemdb%2Funitpackage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echemdb%2Funitpackage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echemdb%2Funitpackage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echemdb%2Funitpackage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/echemdb","download_url":"https://codeload.github.com/echemdb/unitpackage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252259297,"owners_count":21719658,"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-11-13T01:39:48.763Z","updated_at":"2026-01-16T17:45:53.984Z","avatar_url":"https://github.com/echemdb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Binder](https://static.mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/echemdb/unitpackage/0.11.2?labpath=tree%2Fdoc%2Findex.md)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.15644101.svg)](https://zenodo.org/records/15644101)\n\nThis module provides a Python library to interact with a collection of\n[frictionless datapackages](https://frictionlessdata.io/). Such datapackages consist of a CSV (data) file which is annotated with a JSON file.\nThis allows storing additional information such as units used in the columns of a CSV or store metadata describing the underlying data.\nExample datapackages can be found [here](https://github.com/echemdb/unitpackage/tree/main/doc/files/) and a JSON could be structured as follows\n\n```json\n{\n    \"resources\": [\n        {\n            \"name\": \"demo_package\",\n            \"type\": \"table\",\n            \"path\": \"demo_package.csv\",\n            \"scheme\": \"file\",\n            \"format\": \"csv\",\n            \"mediatype\": \"text/csv\",\n            \"encoding\": \"utf-8\",\n            \"schema\": {\n                \"fields\": [\n                    {\n                        \"name\": \"t\",\n                        \"type\": \"number\",\n                        \"unit\": \"s\"\n                    },\n                    {\n                        \"name\": \"j\",\n                        \"type\": \"number\",\n                        \"unit\": \"A / m2\"\n                    }\n                ]\n            },\n            \"metadata\": {\n                \"echemdb\": {\n                    \"description\": \"Sample data for the unitpackage module.\",\n                    \"curation\": {\n                        \"process\": [\n                            {\n                                \"role\": \"experimentalist\",\n                                \"name\": \"John Doe\",\n                                \"laboratory\": \"Institute of Good Scientific Practice\",\n                                \"date\": \"2021-07-09\"\n                            }\n                        ]\n                    }\n                }\n            }\n        }\n    ]\n}\n```\n\nThe metadata of an entries' resource in a collection is accessible from the python API.\n\n```python\n\u003e\u003e\u003e from unitpackage.collection import Collection\n\u003e\u003e\u003e db = Collection.from_local('./doc/files')\n\u003e\u003e\u003e entry = db['demo_package_cv']\n\u003e\u003e\u003e entry.description\n'Sample data for the unitpackage module.'\n```\n\nFrom the API also a simple 2D plot can be drawn.\n\n```python\n\u003e\u003e\u003e entry.plot()\n```\n\u003cimg src=https://raw.githubusercontent.com/echemdb/unitpackage/main/doc/images/readme_demo_plot.png style=\"width:400px\"\u003e\n\nUltimately, the `unitpackage` allows for simple transformation of data within a resource into different units.\n\n```python\n\u003e\u003e\u003e entry.get_unit('j')\n'A / m2'\n\u003e\u003e\u003e entry.df\n          t         E        j\n0  0.000000\t-0.196962 0.043009\n1  0.011368\t-0.196393 0.051408\n...\n\u003e\u003e\u003e entry.rescale({'E' : 'mV', 'j' : 'uA / m2'}).df\n          t           E             j\n0  0.000000 -196.961730  43008.842162\n1  0.011368 -196.393321  51408.199892\n...\n```\n\nCollections for specific measurement types can be created, which provide additional accessibility to the meatadata or simplify the representation of such data in common plot types. An example of such a collection can be found on [echemdb.org](https://www.echemdb.org/cv), which shows Cyclic Voltammetry data annotated following [echemdb's metadata schema](https://github.com/echemdb/metadata-schema), which can be stored in an `Echemdb` collection and is retrieved from the [echemdb data repository](https://github.com/echemdb/electrochemistry-data).\n\nDetailed installation instructions, description of the modules, advanced usage examples, including\nlocal collection creation, are provided in our\n[documentation](https://echemdb.github.io/unitpackage/).\n\n# Installation instructions\n\nThis package is available on [PyPI](https://pypi.org/project/unitpackage/) and can be installed with pip:\n\n```sh .noeval\npip install unitpackage\n```\n\nThe package is also available on [conda-forge](https://github.com/conda-forge/unitpackage-feedstock) an can be installed with conda\n\n```sh .noeval\nconda install -c conda-forge unitpackage\n```\n\nPlease consult our [documentation](https://echemdb.github.io/unitpackage/) for\nmore detailed [installation instructions](https://echemdb.github.io/unitpackage/installation.html).\n\n# License\n\nThe contents of this repository are licensed under the [GNU General Public\nLicense v3.0](./LICENSE) or, at your option, any later version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fechemdb%2Funitpackage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fechemdb%2Funitpackage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fechemdb%2Funitpackage/lists"}