Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
molgenis-emx2-pyclient
Advanced tools
The Molgenis EMX2 Pyclient is a Python package developed to be used for data management on Molgenis EMX2 servers. A detailed overview of the capabilities is presented in the MOLGENIS documentation.
The releases of the package are hosted at PyPI.
The recommended way to install the latest version is through pip
.
pip install molgenis-emx2-pyclient
Releases of the Molgenis EMX2 Pyclient follow the release number of the accompanying release of the Molgenis EMX2 software. Therefore, releases of the Pyclient are less frequent than those of EMX2 and the latest version of the Pyclient may differ from the latest version of Molgenis EMX2.
Added: an optional job
argument to the Client
initialization, allowing the Pyclient to run asynchronous methods within a job in EMX2."
Added: option to specify filename in method export
and to return the exported data in a function
Breaking: introduced asynchronous methods. Users need to explicitly address the asynchronous methods
Added: the ability to use the Pyclient on an EMX2 instance running on a local machine.
Added: the option to filter the results obtained from the get
method based on columns
Added: the method upload_file
which allows the direct upload of files of multiple types to the API
Fixed: issue where NA
values were not properly read in or returned by the API
Fixed: issue in managing data of a table where the table id differs from the table name
Added: option to save data from the get
method as a pandas DataFrame
Fixed: exceptions for metadata classes Column and Schema
Added: metadata classes for Column, Table, Schema
Added: methods create_schema
, delete_schema
, update_schema
, recreate_schema
, get_schema_metadata
Within your Python project import the class Client and instantiate it as a context manager. Operations and queries can then be executed from within the context.
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')
Instead of signing in with a username and password the client can also be used while authorized by a (temporary) token that is generated on the server. See the MOLGENIS documentation for generating tokens
from molgenis_emx2_pyclient import Client
token = '...'
with Client('https://example.molgeniscloud.org', token=token) as client:
# Retrieve signin information
print(client.status)
""" Output:
Host: https://example.molgeniscloud.org
User: token
Status: session-less
Schemas:
CatalogueOntologies
catalogue
ExampleSchema
...
Version: v10.32.1
"""
...
...
Clone the molgenis-emx2
repository from GitHub
git clone git@github.com:molgenis/molgenis-emx2.git
Change the working directory to .../tools/pyclient
On macOS:
python -m venv venv
On Linux:
python3.11 -m venv venv
On Windows:
py -3.11 venv venv
On macOS and Linux:
source venv/bin/activate
On Windows:
.venv\Scripts\activate.bat
pip install -r requirements.txt
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
FAQs
Python client for the Molgenis EMX2 API
We found that molgenis-emx2-pyclient demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.