Package to author schemas using spreadsheets
Project description
Schemasheets - make datamodels using spreadsheets
Create a data dictionary / schema for your data using simple spreadsheets - no coding required.
About
Schemasheets is a framework for managing your schema using spreadsheets (Google Sheets, Excel). It works by compiling down to LinkML, which can itself be compiled to a variety of formalisms, or used for different purposes like data validation
Documentation
See the Schema Sheets Manual
Quick Start
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
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:
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 to synchronize your google sheets with local files using a git-like mechanism
Examples
Finding out more
- Schema Sheets Manual
- linkml/schemasheets code repo
- linkml/linkml main LinkML repo
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file schemasheets-0.3.1.tar.gz
.
File metadata
- Download URL: schemasheets-0.3.1.tar.gz
- Upload date:
- Size: 30.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b5a3dcff03899835e3fefb6fbecc86d33d58e8ded3fd9087c314365da885aa0 |
|
MD5 | 7c7e3b86857b85b87f977ea417648e6e |
|
BLAKE2b-256 | 834de22568b58bee9b33dc221ac23fdb486d47481d165440173f82e150660ca6 |
File details
Details for the file schemasheets-0.3.1-py3-none-any.whl
.
File metadata
- Download URL: schemasheets-0.3.1-py3-none-any.whl
- Upload date:
- Size: 34.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a42562b5002c3854daf4f3c4c50e91a8c613e6784761358d763d044ef35d2fb1 |
|
MD5 | 202b0f220ce124f032891b4248bb062a |
|
BLAKE2b-256 | 13fc01ca8c630bf8dbf2665171394bce788dcc049c1f22e054e833cf1930b771 |