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

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

nextcode-sdk-1.21.0.tar.gz (55.2 kB view details)

Uploaded Source

File details

Details for the file nextcode-sdk-1.21.0.tar.gz.

File metadata

  • Download URL: nextcode-sdk-1.21.0.tar.gz
  • Upload date:
  • Size: 55.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.11

File hashes

Hashes for nextcode-sdk-1.21.0.tar.gz
Algorithm Hash digest
SHA256 0a1d01777aac7e0d28717bbb23aac737c50672979c507418c9edcf1719aa5c01
MD5 3e936ecea83c63b4f5e82594be0bb8a2
BLAKE2b-256 61b91932d1ce7c84dab3051b2f52463ddd6d78acf8b00f3e067e72eca3f95730

See more details on using hashes here.

Supported by

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