transcriptic.config

Connection

class transcriptic.config.Connection(email=None, token=None, organization_id=False, api_root='https://secure.transcriptic.com', organization=False, cookie=False, verbose=False, use_environ=True, analytics=True, user_id='default', feature_groups=[])

Bases: future.types.newobject.newobject

A Connection object is the object used for communicating with Transcriptic.

Local usage: This is most easily instantiated by using the from_file function after calling transcriptic login from the command line.

shell
$ transcriptic login
Email: me@example.com
Password:
Logged in as me@example.com (example-lab)
python
from transcriptic.config import Connection
api = Connection.from_file("~/.transcriptic")

For those using Jupyter notebooks on secure.transcriptic.com (beta), a Connection object is automatically instatianted as api.

python
from transcriptic import api

The api object can then be used for making any api calls. It is recommended to use the objects in transcriptic.objects since that wraps the response in a more friendly format.

Example Usage:

python
api.projects()
api.runs(project_id="p123456789")

If you have multiple organizations and would like to switch to a specific organization, or if you would like to auto-load certain projects, you can use the update_environment function call.

Example Usage:

python
api.update_environment(org_id="my_other_org", project_id="p123")
analyze_launch_request(launch_request_id, test_mode=False)
analyze_run(protocol, test_mode=False)

Analyze given protocol

archive_project(project_id=None)

Archive project with given project_id

create_package(name, description)

Create package with given name and description

create_project(title)

Create project with given title

create_quick_launch(data, project_id=None)

Create quick launch object

dataset(data_id, key='*')

Get dataset with given data_id

datasets(project_id=None, run_id=None, timeout=30.0)

Get datasets belonging to run

delete(route, **kwargs)
delete_package(package_id=None)

Delete package with given package_id

delete_project(project_id=None)

Delete project with given project_id

static from_file(path)

Loads connection from file

get(route, **kwargs)
get_launch_request(protocol_id=None, launch_request_id=None)

Get launch request id

get_organization(org_id=None)

Get particular organization

get_protocols()

Get list of available protocols

get_quick_launch(project_id=None, quick_launch_id=None)

Get quick launch object

get_release_status(package_id=None, release_id=None, timestamp=None)

Get status of current release upload

get_route(method, **kwargs)

Helper function to automatically match and supply required arguments

get_zip(data_id, file_path=None)

Get zip file with given data_id. Downloads to memory and returns a Python ZipFile by default. When dealing with larger files where it may not be desired to load the entire file into memory, specifying file_path will enable the file to be downloaded locally.

Example Usage:

small_zip_id = 'd12345'
small_zip = api.get_zip(small_zip_id)

my_big_zip_id = 'd99999'
api.get_zip(my_big_zip_id, file_path='big_file.zip')
Parameters:
  • data_id (data_id) – Data id of file to download
  • file_path (Optional[str]) – Path to file which to save the response to. If specified, will not return ZipFile explicitly.
Returns:

zip – A Python ZipFile is returned unless file_path is specified

Return type:

zipfile.ZipFile

inventory(query, timeout=30.0, page=0)

Get inventory

kits(query)

Get kits

launch_protocol(params, protocol_id=None)

Launch protocol-id with params

monitoring_data(data_type, instruction_id=None, grouping=None, start_time=None, end_time=None)

Get monitoring_data

organizations()

Get list of organizations

package(package_id=None)

Get package with given package_id

packages()

Get list of packages in organization

payment_methods()
post(route, **kwargs)
post_release(data, package_id=None)

Create release with given data and package_id

preview_protocol(protocol)

Post protocol preview

project(project_id=None)

Get particular project

projects()

Get list of projects in organization

put(route, **kwargs)
raw_image_data(data_id=None)

Get raw image data

resources(query)

Get resources

runs(project_id=None)

Get list of runs in project

save(path)

Saves current connection into specified file, used for CLI

submit_launch_request(launch_request_id, project_id=None, protocol_id=None, title=None, test_mode=False, payment_method_id=None)

Submit specified launch request

submit_run(protocol, project_id=None, title=None, test_mode=False, payment_method_id=None)

Submit given protocol

update_environment(**kwargs)

Update environment variables. To remove an existing variable, set to None

update_headers(kwargs)

Helper function to safely merge and update headers

url(path)

url format helper