# Schemasheets - make datamodels using spreadsheets
<p align="center">
<a href="https://github.com/linkml/schemasheets/actions/workflows/main.yml">
<img alt="Tests" src="https://github.com/linkml/schemasheets/actions/workflows/main.yaml/badge.svg" />
</a>
<a href="https://pypi.org/project/linkml">
<img alt="PyPI" src="https://img.shields.io/pypi/v/linkml" />
</a>
<a href="https://pypi.org/project/sssom">
<img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/sssom" />
</a>
<a href="https://github.com/linkml/schemasheets/blob/main/LICENSE">
<img alt="PyPI - License" src="https://img.shields.io/pypi/l/sssom" />
</a>
<a href="https://github.com/psf/black">
<img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black">
</a>
</p>


Create a [data dictionary](https://linkml.io/schemasheets/howto/data-dictionaries/) / schema for your data using simple spreadsheets - *no coding required*.
## About
Schemasheets is a framework for managing your schema using
spreadsheets ([Google Sheets](https://linkml.io/schemasheets/howto/google-sheets/), [Excel](https://linkml.io/schemasheets/howto/excel/)). It works by compiling down to
[LinkML](https://linkml.io), which can itself be compiled to a variety
of formalisms, or used for different purposes like data validation
- [installation](https://linkml.io/schemasheets/install/)
- [basics](https://linkml.io/schemasheets/intro/basics/)
## Documentation
See the [Schema Sheets Manual](https://linkml.io/schemasheets)
## Quick Start
```bash
pip install schemasheets
```
You should then be able to run the following commands:
- sheets2linkml - Convert schemasheets to a LinkML schema
- linkml2sheets - Convert a LinkML schema to schemasheets
- sheets2project - Generate an entire set of schema files (JSON-Schema, SHACL, SQL, ...) from Schemasheets
As an example, take a look at the different tabs in the google sheet with ID [1wVoaiFg47aT9YWNeRfTZ8tYHN8s8PAuDx5i2HUcDpvQ](https://docs.google.com/spreadsheets/d/1wVoaiFg47aT9YWNeRfTZ8tYHN8s8PAuDx5i2HUcDpvQ/edit#gid=55566104)
The personinfo tab contains the bulk of the metadata elements:
|record|field|key|multiplicity|range|desc|schema.org|
|---|---|---|---|---|---|---|
|`>` class|slot|identifier|cardinality|range|description|exact_mappings: {curie_prefix: sdo}|
|`>`|||||||
||id|yes|1|string|any identifier|identifier|
||description|no|0..1|string|a textual description|description|
|Person||n/a|n/a|n/a|a person,living or dead|Person|
|Person|id|yes|1|string|identifier for a person|identifier|
|Person, Organization|name|no|1|string|full name|name|
|Person|age|no|0..1|decimal|age in years||
|Person|gender|no|0..1|decimal|age in years||
|Person|has medical history|no|0..*|MedicalEvent|medical history||
|Event|||||grouping class for events||
|MedicalEvent||n/a|n/a|n/a|a medical encounter||
|ForProfit|||||||
|NonProfit|||||||
This demonstrator schema contains both *record types* (e.g Person, MedicalEvent) as well as *fields* (e.g. id, age, gender)
You can convert this like this:
```bash
sheets2linkml --gsheet-id 1wVoaiFg47aT9YWNeRfTZ8tYHN8s8PAuDx5i2HUcDpvQ personinfo types prefixes -o personinfo.yaml
```
This will generate a LinkML YAML file `personinfo.yaml` from 3 of the tabs in the google sheet
You can also work directly with TSVs:
```
wget https://raw.githubusercontent.com/linkml/schemasheets/main/tests/input/personinfo.tsv
sheets2linkml personinfo.tsv -o personinfo.yaml
```
We recommend using [COGS](https://linkml.io/schemasheets/howto/google-sheets/) to synchronize your google sheets with local files using a git-like mechanism
## Examples
- [Person Info Schema](https://docs.google.com/spreadsheets/d/1wVoaiFg47aT9YWNeRfTZ8tYHN8s8PAuDx5i2HUcDpvQ/edit#gid=55566104)
- [Movies Property Graph Schema](https://docs.google.com/spreadsheets/d/1oMrzA41tg_nisdWInnqKJrcvv30dOXuwAhznJYYPSB8/edit?gid=1499822522#gid=1499822522)
## Finding out more
* [Schema Sheets Manual](https://linkml.io/schemasheets)
* [Specification](https://linkml.io/schemasheets/specification/)
* [Internal Datamodel](https://linkml.io/schemasheets/datamodel/)
* [linkml/schemasheets](https://github.com/linkml/schemasheets) code repo
* [linkml/linkml](https://github.com/linkml/linkml) main LinkML repo
Raw data
{
"_id": null,
"home_page": "https://github.com/linkml/schemasheets",
"name": "schemasheets",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": null,
"author": "cmungall",
"author_email": "cjm@berkeleybop.org",
"download_url": "https://files.pythonhosted.org/packages/83/4d/e22568b58bee9b33dc221ac23fdb486d47481d165440173f82e150660ca6/schemasheets-0.3.1.tar.gz",
"platform": null,
"description": "# Schemasheets - make datamodels using spreadsheets\n\n<p align=\"center\">\n <a href=\"https://github.com/linkml/schemasheets/actions/workflows/main.yml\">\n <img alt=\"Tests\" src=\"https://github.com/linkml/schemasheets/actions/workflows/main.yaml/badge.svg\" />\n </a>\n <a href=\"https://pypi.org/project/linkml\">\n <img alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/linkml\" />\n </a>\n <a href=\"https://pypi.org/project/sssom\">\n <img alt=\"PyPI - Python Version\" src=\"https://img.shields.io/pypi/pyversions/sssom\" />\n </a>\n <a href=\"https://github.com/linkml/schemasheets/blob/main/LICENSE\">\n <img alt=\"PyPI - License\" src=\"https://img.shields.io/pypi/l/sssom\" />\n </a>\n <a href=\"https://github.com/psf/black\">\n <img src=\"https://img.shields.io/badge/code%20style-black-000000.svg\" alt=\"Code style: black\">\n </a>\n</p>\n\n\n\n\nCreate a [data dictionary](https://linkml.io/schemasheets/howto/data-dictionaries/) / schema for your data using simple spreadsheets - *no coding required*.\n\n## About\n\nSchemasheets is a framework for managing your schema using\nspreadsheets ([Google Sheets](https://linkml.io/schemasheets/howto/google-sheets/), [Excel](https://linkml.io/schemasheets/howto/excel/)). It works by compiling down to\n[LinkML](https://linkml.io), which can itself be compiled to a variety\nof formalisms, or used for different purposes like data validation\n\n- [installation](https://linkml.io/schemasheets/install/)\n- [basics](https://linkml.io/schemasheets/intro/basics/)\n\n## Documentation\n\nSee the [Schema Sheets Manual](https://linkml.io/schemasheets)\n\n## Quick Start\n\n```bash\npip install schemasheets\n```\n\nYou should then be able to run the following commands:\n\n- sheets2linkml - Convert schemasheets to a LinkML schema\n- linkml2sheets - Convert a LinkML schema to schemasheets\n- sheets2project - Generate an entire set of schema files (JSON-Schema, SHACL, SQL, ...) from Schemasheets\n\nAs an example, take a look at the different tabs in the google sheet with ID [1wVoaiFg47aT9YWNeRfTZ8tYHN8s8PAuDx5i2HUcDpvQ](https://docs.google.com/spreadsheets/d/1wVoaiFg47aT9YWNeRfTZ8tYHN8s8PAuDx5i2HUcDpvQ/edit#gid=55566104)\n\nThe personinfo tab contains the bulk of the metadata elements:\n\n|record|field|key|multiplicity|range|desc|schema.org|\n|---|---|---|---|---|---|---|\n|`>` class|slot|identifier|cardinality|range|description|exact_mappings: {curie_prefix: sdo}|\n|`>`|||||||\n||id|yes|1|string|any identifier|identifier|\n||description|no|0..1|string|a textual description|description|\n|Person||n/a|n/a|n/a|a person,living or dead|Person|\n|Person|id|yes|1|string|identifier for a person|identifier|\n|Person, Organization|name|no|1|string|full name|name|\n|Person|age|no|0..1|decimal|age in years||\n|Person|gender|no|0..1|decimal|age in years||\n|Person|has medical history|no|0..*|MedicalEvent|medical history||\n|Event|||||grouping class for events||\n|MedicalEvent||n/a|n/a|n/a|a medical encounter||\n|ForProfit|||||||\n|NonProfit|||||||\n\nThis demonstrator schema contains both *record types* (e.g Person, MedicalEvent) as well as *fields* (e.g. id, age, gender)\n\nYou can convert this like this:\n\n```bash\nsheets2linkml --gsheet-id 1wVoaiFg47aT9YWNeRfTZ8tYHN8s8PAuDx5i2HUcDpvQ personinfo types prefixes -o personinfo.yaml\n```\n\nThis will generate a LinkML YAML file `personinfo.yaml` from 3 of the tabs in the google sheet\n\nYou can also work directly with TSVs:\n\n```\nwget https://raw.githubusercontent.com/linkml/schemasheets/main/tests/input/personinfo.tsv \nsheets2linkml personinfo.tsv -o personinfo.yaml\n```\n\nWe recommend using [COGS](https://linkml.io/schemasheets/howto/google-sheets/) to synchronize your google sheets with local files using a git-like mechanism\n\n## Examples\n\n- [Person Info Schema](https://docs.google.com/spreadsheets/d/1wVoaiFg47aT9YWNeRfTZ8tYHN8s8PAuDx5i2HUcDpvQ/edit#gid=55566104)\n- [Movies Property Graph Schema](https://docs.google.com/spreadsheets/d/1oMrzA41tg_nisdWInnqKJrcvv30dOXuwAhznJYYPSB8/edit?gid=1499822522#gid=1499822522)\n\n## Finding out more\n\n* [Schema Sheets Manual](https://linkml.io/schemasheets)\n * [Specification](https://linkml.io/schemasheets/specification/)\n * [Internal Datamodel](https://linkml.io/schemasheets/datamodel/)\n* [linkml/schemasheets](https://github.com/linkml/schemasheets) code repo\n* [linkml/linkml](https://github.com/linkml/linkml) main LinkML repo\n\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Package to author schemas using spreadsheets",
"version": "0.3.1",
"project_urls": {
"Documentation": "https://github.com/linkml/schemasheets",
"Homepage": "https://github.com/linkml/schemasheets",
"Repository": "https://github.com/linkml/schemasheets"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "13fc01ca8c630bf8dbf2665171394bce788dcc049c1f22e054e833cf1930b771",
"md5": "202b0f220ce124f032891b4248bb062a",
"sha256": "a42562b5002c3854daf4f3c4c50e91a8c613e6784761358d763d044ef35d2fb1"
},
"downloads": -1,
"filename": "schemasheets-0.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "202b0f220ce124f032891b4248bb062a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 34701,
"upload_time": "2024-08-03T01:10:51",
"upload_time_iso_8601": "2024-08-03T01:10:51.978532Z",
"url": "https://files.pythonhosted.org/packages/13/fc/01ca8c630bf8dbf2665171394bce788dcc049c1f22e054e833cf1930b771/schemasheets-0.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "834de22568b58bee9b33dc221ac23fdb486d47481d165440173f82e150660ca6",
"md5": "7c7e3b86857b85b87f977ea417648e6e",
"sha256": "4b5a3dcff03899835e3fefb6fbecc86d33d58e8ded3fd9087c314365da885aa0"
},
"downloads": -1,
"filename": "schemasheets-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "7c7e3b86857b85b87f977ea417648e6e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 30571,
"upload_time": "2024-08-03T01:10:53",
"upload_time_iso_8601": "2024-08-03T01:10:53.513455Z",
"url": "https://files.pythonhosted.org/packages/83/4d/e22568b58bee9b33dc221ac23fdb486d47481d165440173f82e150660ca6/schemasheets-0.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-03 01:10:53",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "linkml",
"github_project": "schemasheets",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "schemasheets"
}