Skip to main content

Python SDK for Genuity Science Services

Project description

Latest version on PyPi Build Status codecov Supported Python versions Code style: black

nextcode Python SDK

Nextcode-sdk is a python package for interfacing with Wuxi Nextcode services.

Installation

$ pip install nextcode-sdk -U
$ pip install nextcode-sdk[jupyter] -U

Getting started

import nextcode
client = nextcode.Client(api_key="xxx")
qry = client.service("query")
qry.status()
qry.get_queries()
qry.get_query(query_id)
qry.list_templates()

Jupyter notebooks

To start using the python sdk in Jupyter Notebooks you will first need to install it using the jupyter extras and then load the gor % magic extension.

! pip install nextcode-sdk[jupyter] -U
%load_ext nextcode

Jupyter notebooks running on the Wuxi Nextcode servers are preconfigured with a GOR_API_KEY and GOR_PROJECT. If you are running outside such an environment you will need to configure your environment accordingly:

%env GOR_API_KEY="***"
%env GOR_API_PROJECT="test_project"
# optionally set the LOG_QUERY environment variable to get more information about running queries.
%env LOG_QUERY=1

Now you can run gor with the following syntax:

# simple one-liner
%gor gor #dbsnp# | top 100

# one-liner which outputs to local variable as a pandas dataframe
results = %gor gor #dbsnp# | top 100

# multi-line statement
%%gor 
gor #dbsnp# 
  | top 100

# multi-line statement which writes results into project folder
%%gor user_data/results.tsv <<
nor #dbsnp# 
  | top 100

# output results to local variable as a pandas dataframe
%%gor myvar <<
nor #dbsnp# 
  | top 100

# read from a pandas dataframe in a local variable
%%gor
nor [var:myvar] 
  | top 100

# reference a local variable
num = 10
%%gor
nor [var:myvar] 
  | top $num

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

nextcode_sdk-2.1.2.tar.gz (56.7 kB view details)

Uploaded Source

Built Distribution

nextcode_sdk-2.1.2-py3-none-any.whl (76.6 kB view details)

Uploaded Python 3

File details

Details for the file nextcode_sdk-2.1.2.tar.gz.

File metadata

  • Download URL: nextcode_sdk-2.1.2.tar.gz
  • Upload date:
  • Size: 56.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.10.15 Linux/5.10.219-208.866.amzn2.x86_64

File hashes

Hashes for nextcode_sdk-2.1.2.tar.gz
Algorithm Hash digest
SHA256 93e3240684dec8c2eb5dc6627c17330f789895150f0f6800014e46f69759db91
MD5 d23ac2e71e6601ac155a67a43e53f46e
BLAKE2b-256 07be984dab57031c850b3410e7c5b47d624101f0ea56d42a1f273e940dcc0a12

See more details on using hashes here.

File details

Details for the file nextcode_sdk-2.1.2-py3-none-any.whl.

File metadata

  • Download URL: nextcode_sdk-2.1.2-py3-none-any.whl
  • Upload date:
  • Size: 76.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.10.15 Linux/5.10.219-208.866.amzn2.x86_64

File hashes

Hashes for nextcode_sdk-2.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 461c8885c263c32fac620164f0dd41ca681016c5e5e51a8a585245a5b1f897cd
MD5 e0957349939f6804a11e0612c5b94e51
BLAKE2b-256 fd2d2629695abcb0d1b4925e556d1e20e085e33a590d8a606ea7fb8491d3d489

See more details on using hashes here.

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