Skip to main content

Package to author schemas using spreadsheets

Project description

Schemasheets - make datamodels using spreadsheets

Tests PyPI PyPI - Python Version PyPI - License Code style: black

linkml logo google sheets logo

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

Finding out more

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

schemasheets-0.1.21.tar.gz (24.1 kB view details)

Uploaded Source

Built Distribution

schemasheets-0.1.21-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

Details for the file schemasheets-0.1.21.tar.gz.

File metadata

  • Download URL: schemasheets-0.1.21.tar.gz
  • Upload date:
  • Size: 24.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for schemasheets-0.1.21.tar.gz
Algorithm Hash digest
SHA256 5768b07b25a5adbee56af7c86a493c8ba1428426d5b211c5d7fe7a22c3109cee
MD5 4c9fa55dcb25acff691887729270a175
BLAKE2b-256 14e079b3979755acdf4085d174c5ca6738b86c61c1832042b7421a13cbfcf58d

See more details on using hashes here.

Provenance

File details

Details for the file schemasheets-0.1.21-py3-none-any.whl.

File metadata

File hashes

Hashes for schemasheets-0.1.21-py3-none-any.whl
Algorithm Hash digest
SHA256 41f993cdc68f21f7ae0fa7f62a5ed02b5b8ce40c52ef29ae6486f6fe7bc7dd0a
MD5 bac31c61c448d363c8e3e74131a7e5e0
BLAKE2b-256 c48a886d23f52c148c6570da8f66357f30d1afe8613de4b29299bcc14ffbf5f5

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page