Python client for the Molgenis EMX2 API
Project description
Installation
pip install molgenis_emx2_pyclient
How to use
Within your Python project import the class Client and use it as a context manager
from molgenis_emx2_pyclient import Client
username = 'username'
password = '...'
with Client('https://example.molgeniscloud.org') as client:
client.signin(username, password)
# Retrieve signin information
print(client.status)
""" Output:
Host: https://example.molgeniscloud.org
Status: Signed in
Schemas:
CatalogueOntologies
catalogue
ExampleSchema
...
Version: v10.10.1
"""
# Retrieve data from a table on a schema
data = client.get(schema='ExampleSchema', table='Cohorts')
# Create a new schema on the server
client.create_schema(name='New Schema')
# Delete a schema from the server
client.delete_schema(name='New Schema')
Development
Clone the molgenis-emx2
repository from GitHub
git clone git@github.com:molgenis/molgenis-emx2.git
Change the working directory to .../tools/pyclient
Create a virtual Python environment
On macOS:
python -m venv venv
On Linux:
python3.11 -m venv venv
On Windows:
py -3.11 venv venv
Activate the virtual environment
On macOS and Linux:
source venv/bin/activate
On Windows:
.venv\Scripts\activate.bat
Install the script dependencies
pip install -r requirements.txt
Build
Before building the source, the package build
needs to be installed.
(venv) $ pip install build
(venv) $ python -m build
(venv) $ pip install dist/molgenis_emx2_pyclient*.whl
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
Close
Hashes for molgenis_emx2_pyclient-10.13.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc32e24f1ad779e68bbd7ad212d60b723e3247127a4afdd00142a05c91ac36cc |
|
MD5 | 8c05ccb796d8c000bb7a7491b0cc5654 |
|
BLAKE2b-256 | 9cc54cd531978484b4ffc48ef6a86c46245756645baf4e8203bfdb7be5ab306c |
Close
Hashes for molgenis_emx2_pyclient-10.13.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d09de0bd7421ba8d534b3daf12b0dc95b4ccbb29e2590584a215809117386688 |
|
MD5 | 6bf34fd631c824abf14517c1f23c0bd0 |
|
BLAKE2b-256 | a448aa3d434dac5748528ccb1a56f6bca58d35251d4cd2b806435c29ece9f323 |