sheet2linkml
A python package for converting the CRDC-H data model, which is currently stored in a Google Sheet. The command line utility built into the package can be used to generate a LinkML representation of the CRDC-H data model.
Installation Requirements and Pre-requisites
- Python 3.7 or higher
- pyenv
- If you do not have a version of Python greater than 3.9, it is recommended to use
pyenvto be able to easily use and switch between multiple Python versions. - If you’re experiencing issues with pyenv on macOS, you can consider using miniconda.
- If you do not have a version of Python greater than 3.9, it is recommended to use
- poetry
- One-time installation commands are available for osx/linux/bash on windows and for windows powershell.
If you are using a Windows machine, typical bash programs will not work on cmd in the same way as they work in the Linux/MacOS terminals. To circumvent this, it is recommended that you use one of the following Bash on Windows strategies:
so you can easily execute the command line utilities that are described later in these docs.
Installing
Create and activate a Python 3.9+ virtual environment within which you can install the package:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install sheet2linkml
Authorization
sheet2linkml uses the pygsheets library in order to access sheets in
Google Drive. To authorize it to access your Google Sheets, you will need to create and download Google Drive client credentials. First,
enable the Google Drive API. After the API is enabled,
create and download the client credentials
from the Google API Console. Save the file as google_api_credentials.json in
the root directory of this project. Detailed instructions and screenshots
are also available from the pygsheets documentation.
Command Line Client Usage
Identify the Google Sheet that you want to convert to LinkML. Note that sheet2linkml is not currently a general-purpose Google Sheet to LinkML converter. It will only work with Google Sheets that have been written in a particular, currently undefined format.
Contact your CCDH colleagues to obtain the correct sheet ID and assert it either in a .env file or in the shell, like this:
export CDM_GOOGLE_SHEET_ID=1oWS7cao-fgz2MKWtyr8h2dEL9unX__0bJrWKv6mQmM4
A google_api_credentials.json file is also required in the root of this repo as detailed in the Authorization section above.
And the user is responsible for defining
~/path/to/crdch_model.yaml~/path/to/logging.ini./logging.inimay be adaquate for many users
Then perform the conversion:
sheet2linkml --output ~/path/to/crdch_model.yaml --logging-config ~/path/to/logging.ini
Metadata
Release files for sheet2linkml 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sheet2linkml-1.3.0.tar.gz | 25.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sheet2linkml-1.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 57.9 kB
Release files / sheet2linkml-1.3.0.tar.gz
| Download URL | sheet2linkml-1.3.0.tar.gz |
|---|---|
| Size | 25.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c4691e726dff90080dd144942434832059c74804fd3236afb4fd34dd661bfe1e
|
|
BLAKE2b-256 checksum How to use checksums |
b69388d91784fe889627598ab2b5f6a205cd8fa721ce69539d9117b14d859752
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.10 CPython/3.9.7 Darwin/20.6.0
|
Release files / sheet2linkml-1.3.0-py3-none-any.whl
| Download URL | sheet2linkml-1.3.0-py3-none-any.whl |
|---|---|
| Size | 32.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
64842e36b195a5ab58eb4d4b71a548af8d28f45e82da0236d0e41bf074a0c988
|
|
BLAKE2b-256 checksum How to use checksums |
90c368e98d840c3b4660990e3a6d9773bcc09978c6601d326571c6d8b28258d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.10 CPython/3.9.7 Darwin/20.6.0
|