sevenbridges-python


Namesevenbridges-python JSON
Version 2.11.0 PyPI version JSON
download
home_pagehttps://github.com/sbg/sevenbridges-python
SummarySBG API python client bindings
upload_time2024-03-18 15:19:29
maintainerSeven Bridges Genomics Inc.
docs_urlNone
author
requires_python
licenseApache Software License 2.0
keywords sevenbridges sbg api cgc cancer genomics cloud
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            sevenbridges-python
===================

[![PyPI version](https://badge.fury.io/py/sevenbridges-python.svg)](https://pypi.python.org/pypi/sevenbridges-python)
[![Documentation](https://readthedocs.org/projects/sevenbridges-python/badge/?version=latest)](http://sevenbridges-python.readthedocs.org/en/latest/)
[![Licence](https://img.shields.io/badge/licence-Apache-orange.svg)](https://github.com/sbg/sevenbridges-python/blob/develop/LICENCE)

[CHANGELOG](https://github.com/sbg/sevenbridges-python/releases)

sevenbridges-python is a [Python](http://www.python.org/) library that
provides an interface for the [Seven Bridges Platform](https://www.sbgenomics.com/) the
[Cancer Genomics Cloud](http://www.cancergenomicscloud.org/) and
[Cavatica](http://www.cavatica.org) public APIs. It works with Python
versions 3.6+.

The [Seven Bridges Platform](https://www.sbgenomics.com/) is a
cloud-based environment for conducting bioinformatic analyses. It is a
central hub for teams to store, analyze, and jointly interpret their
bioinformatic data. The Platform co-locates analysis pipelines alongside
the largest genomic datasets to optimize processing, allocating storage
and compute resources on demand.

The [The Cancer Genomics Cloud (CGC)](http://www.cancergenomicscloud.org/), powered by
[Seven Bridges](https://www.sbgenomics.com/), is also a cloud-based computation
environment. It was built as one of three pilot systems funded by the
[National Cancer Institute](http://www.cancer.gov/) to explore the
paradigm of colocalizing massive genomics datasets, like The
[Cancer Genomics Atlas (TCGA)](http://cancergenome.nih.gov/), alongside secure
and scalable computational resources to analyze them. The CGC makes more
than a petabyte of multi-dimensional data available immediately to
authorized researchers. You can add your own data to analyze alongside
TCGA using predefined analytical workflows or your own tools.

The [Cavatica](http://www.cavatica.org/),
powered by [Seven Bridges](https://www.sbgenomics.com/), is a data analysis and sharing
platform designed to accelerate discovery in a scalable, cloud-based
compute environment where data, results, and workflows are shared among
the world's research community. Cavatica is built in collaboration with
the Children Hospital of Philadelphia and it is focused on pediatric
data.

Documentation
-------------

The latest documentation can be found on [readthedocs](http://sevenbridges-python.readthedocs.org/en/latest).

Installation
------------

The easiest way to install sevenbridges-python is using pip:

    $ pip install sevenbridges-python

Get the Code
------------

sevenbridges-python is actively developed on GitHub, where the code is
always available.

The easiest way to obtain the source is to clone the public repository :

    $ git clone git://github.com/sbg/sevenbridges-python.git

Once you have a copy of the source, you can embed it in your Python
package, or install it into your site-packages by invoking: :

    $ python setup.py install

If you are interested in reviewing this documentation locally, clone
this repository, position yourself in the docs directory and after
installing `requirements-dev.txt`, invoke:

    $ make html

Run Tests
---------

In order to run tests clone this repository, position yourself in the
root of the cloned project and after installing `requirements-dev.txt`, invoke:

    $ pytest

Authentication and Configuration
--------------------------------

In order to authenticate with the API, you should pass the following
items to sevenbridges-python:

(a) Your authentication token
(b) The API endpoint you will be interacting with. This is either the
    endpoint for the Seven Bridges Platform or for the Seven Bridges
    Cancer Genomics Cloud (CGC) or for CAVATICA.

You can find your authentication token on the respective pages:

- <https://igor.sbgenomics.com/developer> for the Seven Bridges Platform
- <https://cgc.sbgenomics.com/developer> for the CGC
- <https://cavatica.sbgenomics.com/developer> for Cavatica

The API endpoints for each environment are:

- <https://api.sbgenomics.com/v2> for the Seven Bridges Platform
- <https://cgc-api.sbgenomics.com/v2> for the CGC.
- <https://cavatica-api.sbgenomics.com/v2> for CAVATICA

For more information about the API, including details of the available
parameters for each API call, you should check the API documentation
before using this library:

- <http://docs.sevenbridges.com/docs/the-api> for the Seven Bridges Platform.
- <http://docs.cancergenomicscloud.org/docs/the-cgc-api> for the CGC.
- <http://docs.cavatica.org/docs/the-api> for CAVATICA

Initialize configuration using the configuration file
-----------------------------------------------------

Once you obtain your authentication token, you can pass it to the Config
object. You can instantiate the API object by passing the appropriate
configuration. There are three ways you can pass configure the library:

1.  Pass parameters `url` and `token` explicitly when initializing the
    config object.
2.  Put the API endpoint and token in the environment variables
    `API_URL` and `AUTH_TOKEN` respectively.
3.  Use the configuration file `$HOME/.sevenbridges/credentials` with
    defined parameters.

### Explicit initialization

```python
import sevenbridges as sbg
api = sbg.Api(url='https://api.sbgenomics.com/v2', token='<TOKEN_HERE>')
```

### Initialization via environment variables

```python
import os
import sevenbridges as sbg

# Usually these would be set in the shell beforehand
os.environ['SB_API_ENDPOINT'] = 'https://api.sbgenomics.com/v2'
os.environ['SB_AUTH_TOKEN'] = '<TOKEN_HERE>'

api = sbg.Api()
```

### Initialization via config file

```python
import sevenbridges as sbg
config = sbg.Config(profile='cgc')
api = sbg.Api(config=config)
```

### Notes on config file format

The `$HOME/.sevenbridges/credentials` file has a simple .ini file
format, for example:

    [default]
    api_endpoint = https://api.sbgenomics.com/v2
    auth_token = <TOKEN_HERE>

    [cgc]
    api_endpoint = https://cgc-api.sbgenomics.com/v2
    auth_token = <TOKEN_HERE>

    [cavatica]
    api_endpoint = https://cavatica-api.sbgenomics.com/v2
    auth_token = <TOKEN_HERE>

#### Initializing the sevenbridges-python library

The API object represents the central resource for querying, saving and
performing all other actions on your resources. Once you have
instantiated the configuration class, pass it to the API class
constructor.

```python
import sevenbridges as sbg
api_config = sbg.Config()  # Or any other choice of initialization method
api = sbg.Api(config=api_config)
```

Examples
--------

The following code illustrates the way the library should be used. For
more detailed examples consult the documentation, hosted on readthedocs.

```python
import sevenbridges as sbg

api_config = sbg.Config()  # Or any other choice of initialization method
api = sbg.Api(config=api_config)

# Get current user
user = api.users.me()

# Query your projects
projects = api.projects.query(limit=100)

# Fetch project files
project = projects[0]
files = project.get_files()
```

Contributing
------------

Contributions, bug reports and issues are very welcome.

You can make your own contributions by forking the develop branch of
this repository, making your changes, and issuing pull request on the
develop branch. Contributors should read the [Seven Bridges Notice to Contributors](CONTRIBUTORS_NOTICE.md) and sign the [Seven Bridges Contributor Agreement](https://secure.na1.echosign.com/public/esignWidget?wid=CBFCIBAA3AAABLblqZhAqt_9rHEqy2MggS0uWRmKHUN2HYi8DWNjkgg5N68iKAhRFTy7k2AOEpRHMMorxc_0*)
before submitting a pull request.

Copyright
---------

Copyright (c) 2020 Seven Bridges Genomics, Inc. All rights
reserved.

This project is open-source via the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0).



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/sbg/sevenbridges-python",
    "name": "sevenbridges-python",
    "maintainer": "Seven Bridges Genomics Inc.",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "dejan.knezevic@sbgenomics.com",
    "keywords": "sevenbridges,sbg,api,cgc,cancer,genomics,cloud",
    "author": "",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/b0/57/043d09cbc1b4472713df148ccca03656c777356f686e979461d9b8e59dd3/sevenbridges-python-2.11.0.tar.gz",
    "platform": "Windows",
    "description": "sevenbridges-python\n===================\n\n[![PyPI version](https://badge.fury.io/py/sevenbridges-python.svg)](https://pypi.python.org/pypi/sevenbridges-python)\n[![Documentation](https://readthedocs.org/projects/sevenbridges-python/badge/?version=latest)](http://sevenbridges-python.readthedocs.org/en/latest/)\n[![Licence](https://img.shields.io/badge/licence-Apache-orange.svg)](https://github.com/sbg/sevenbridges-python/blob/develop/LICENCE)\n\n[CHANGELOG](https://github.com/sbg/sevenbridges-python/releases)\n\nsevenbridges-python is a [Python](http://www.python.org/) library that\nprovides an interface for the [Seven Bridges Platform](https://www.sbgenomics.com/) the\n[Cancer Genomics Cloud](http://www.cancergenomicscloud.org/) and\n[Cavatica](http://www.cavatica.org) public APIs. It works with Python\nversions 3.6+.\n\nThe [Seven Bridges Platform](https://www.sbgenomics.com/) is a\ncloud-based environment for conducting bioinformatic analyses. It is a\ncentral hub for teams to store, analyze, and jointly interpret their\nbioinformatic data. The Platform co-locates analysis pipelines alongside\nthe largest genomic datasets to optimize processing, allocating storage\nand compute resources on demand.\n\nThe [The Cancer Genomics Cloud (CGC)](http://www.cancergenomicscloud.org/), powered by\n[Seven Bridges](https://www.sbgenomics.com/), is also a cloud-based computation\nenvironment. It was built as one of three pilot systems funded by the\n[National Cancer Institute](http://www.cancer.gov/) to explore the\nparadigm of colocalizing massive genomics datasets, like The\n[Cancer Genomics Atlas (TCGA)](http://cancergenome.nih.gov/), alongside secure\nand scalable computational resources to analyze them. The CGC makes more\nthan a petabyte of multi-dimensional data available immediately to\nauthorized researchers. You can add your own data to analyze alongside\nTCGA using predefined analytical workflows or your own tools.\n\nThe [Cavatica](http://www.cavatica.org/),\npowered by [Seven Bridges](https://www.sbgenomics.com/), is a data analysis and sharing\nplatform designed to accelerate discovery in a scalable, cloud-based\ncompute environment where data, results, and workflows are shared among\nthe world's research community. Cavatica is built in collaboration with\nthe Children Hospital of Philadelphia and it is focused on pediatric\ndata.\n\nDocumentation\n-------------\n\nThe latest documentation can be found on [readthedocs](http://sevenbridges-python.readthedocs.org/en/latest).\n\nInstallation\n------------\n\nThe easiest way to install sevenbridges-python is using pip:\n\n    $ pip install sevenbridges-python\n\nGet the Code\n------------\n\nsevenbridges-python is actively developed on GitHub, where the code is\nalways available.\n\nThe easiest way to obtain the source is to clone the public repository :\n\n    $ git clone git://github.com/sbg/sevenbridges-python.git\n\nOnce you have a copy of the source, you can embed it in your Python\npackage, or install it into your site-packages by invoking: :\n\n    $ python setup.py install\n\nIf you are interested in reviewing this documentation locally, clone\nthis repository, position yourself in the docs directory and after\ninstalling `requirements-dev.txt`, invoke:\n\n    $ make html\n\nRun Tests\n---------\n\nIn order to run tests clone this repository, position yourself in the\nroot of the cloned project and after installing `requirements-dev.txt`, invoke:\n\n    $ pytest\n\nAuthentication and Configuration\n--------------------------------\n\nIn order to authenticate with the API, you should pass the following\nitems to sevenbridges-python:\n\n(a) Your authentication token\n(b) The API endpoint you will be interacting with. This is either the\n    endpoint for the Seven Bridges Platform or for the Seven Bridges\n    Cancer Genomics Cloud (CGC) or for CAVATICA.\n\nYou can find your authentication token on the respective pages:\n\n- <https://igor.sbgenomics.com/developer> for the Seven Bridges Platform\n- <https://cgc.sbgenomics.com/developer> for the CGC\n- <https://cavatica.sbgenomics.com/developer> for Cavatica\n\nThe API endpoints for each environment are:\n\n- <https://api.sbgenomics.com/v2> for the Seven Bridges Platform\n- <https://cgc-api.sbgenomics.com/v2> for the CGC.\n- <https://cavatica-api.sbgenomics.com/v2> for CAVATICA\n\nFor more information about the API, including details of the available\nparameters for each API call, you should check the API documentation\nbefore using this library:\n\n- <http://docs.sevenbridges.com/docs/the-api> for the Seven Bridges Platform.\n- <http://docs.cancergenomicscloud.org/docs/the-cgc-api> for the CGC.\n- <http://docs.cavatica.org/docs/the-api> for CAVATICA\n\nInitialize configuration using the configuration file\n-----------------------------------------------------\n\nOnce you obtain your authentication token, you can pass it to the Config\nobject. You can instantiate the API object by passing the appropriate\nconfiguration. There are three ways you can pass configure the library:\n\n1.  Pass parameters `url` and `token` explicitly when initializing the\n    config object.\n2.  Put the API endpoint and token in the environment variables\n    `API_URL` and `AUTH_TOKEN` respectively.\n3.  Use the configuration file `$HOME/.sevenbridges/credentials` with\n    defined parameters.\n\n### Explicit initialization\n\n```python\nimport sevenbridges as sbg\napi = sbg.Api(url='https://api.sbgenomics.com/v2', token='<TOKEN_HERE>')\n```\n\n### Initialization via environment variables\n\n```python\nimport os\nimport sevenbridges as sbg\n\n# Usually these would be set in the shell beforehand\nos.environ['SB_API_ENDPOINT'] = 'https://api.sbgenomics.com/v2'\nos.environ['SB_AUTH_TOKEN'] = '<TOKEN_HERE>'\n\napi = sbg.Api()\n```\n\n### Initialization via config file\n\n```python\nimport sevenbridges as sbg\nconfig = sbg.Config(profile='cgc')\napi = sbg.Api(config=config)\n```\n\n### Notes on config file format\n\nThe `$HOME/.sevenbridges/credentials` file has a simple .ini file\nformat, for example:\n\n    [default]\n    api_endpoint = https://api.sbgenomics.com/v2\n    auth_token = <TOKEN_HERE>\n\n    [cgc]\n    api_endpoint = https://cgc-api.sbgenomics.com/v2\n    auth_token = <TOKEN_HERE>\n\n    [cavatica]\n    api_endpoint = https://cavatica-api.sbgenomics.com/v2\n    auth_token = <TOKEN_HERE>\n\n#### Initializing the sevenbridges-python library\n\nThe API object represents the central resource for querying, saving and\nperforming all other actions on your resources. Once you have\ninstantiated the configuration class, pass it to the API class\nconstructor.\n\n```python\nimport sevenbridges as sbg\napi_config = sbg.Config()  # Or any other choice of initialization method\napi = sbg.Api(config=api_config)\n```\n\nExamples\n--------\n\nThe following code illustrates the way the library should be used. For\nmore detailed examples consult the documentation, hosted on readthedocs.\n\n```python\nimport sevenbridges as sbg\n\napi_config = sbg.Config()  # Or any other choice of initialization method\napi = sbg.Api(config=api_config)\n\n# Get current user\nuser = api.users.me()\n\n# Query your projects\nprojects = api.projects.query(limit=100)\n\n# Fetch project files\nproject = projects[0]\nfiles = project.get_files()\n```\n\nContributing\n------------\n\nContributions, bug reports and issues are very welcome.\n\nYou can make your own contributions by forking the develop branch of\nthis repository, making your changes, and issuing pull request on the\ndevelop branch. Contributors should read the [Seven Bridges Notice to Contributors](CONTRIBUTORS_NOTICE.md) and sign the [Seven Bridges Contributor Agreement](https://secure.na1.echosign.com/public/esignWidget?wid=CBFCIBAA3AAABLblqZhAqt_9rHEqy2MggS0uWRmKHUN2HYi8DWNjkgg5N68iKAhRFTy7k2AOEpRHMMorxc_0*)\nbefore submitting a pull request.\n\nCopyright\n---------\n\nCopyright (c) 2020 Seven Bridges Genomics, Inc. All rights\nreserved.\n\nThis project is open-source via the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0).\n\n\n",
    "bugtrack_url": null,
    "license": "Apache Software License 2.0",
    "summary": "SBG API python client bindings",
    "version": "2.11.0",
    "project_urls": {
        "Homepage": "https://github.com/sbg/sevenbridges-python"
    },
    "split_keywords": [
        "sevenbridges",
        "sbg",
        "api",
        "cgc",
        "cancer",
        "genomics",
        "cloud"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4ed3ea7455c1734f6adccee14c8da7d0e4e3d1c7b199a126b3658c0089c4b3ee",
                "md5": "412d2d58e21bf58710686d22009aa002",
                "sha256": "add3e7dbe92cd9ed56047bedab24e3030aae1976e9a15af9557df3f09ad23c70"
            },
            "downloads": -1,
            "filename": "sevenbridges_python-2.11.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "412d2d58e21bf58710686d22009aa002",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 102439,
            "upload_time": "2024-03-18T15:19:26",
            "upload_time_iso_8601": "2024-03-18T15:19:26.926643Z",
            "url": "https://files.pythonhosted.org/packages/4e/d3/ea7455c1734f6adccee14c8da7d0e4e3d1c7b199a126b3658c0089c4b3ee/sevenbridges_python-2.11.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b057043d09cbc1b4472713df148ccca03656c777356f686e979461d9b8e59dd3",
                "md5": "228020acbd95048b56dc5ea0259e0bd9",
                "sha256": "0a20b2f75cc9110adad747c0cfe7b7389b1c978008a77fae942ab66614f32534"
            },
            "downloads": -1,
            "filename": "sevenbridges-python-2.11.0.tar.gz",
            "has_sig": false,
            "md5_digest": "228020acbd95048b56dc5ea0259e0bd9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 66669,
            "upload_time": "2024-03-18T15:19:29",
            "upload_time_iso_8601": "2024-03-18T15:19:29.175282Z",
            "url": "https://files.pythonhosted.org/packages/b0/57/043d09cbc1b4472713df148ccca03656c777356f686e979461d9b8e59dd3/sevenbridges-python-2.11.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-18 15:19:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sbg",
    "github_project": "sevenbridges-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "sevenbridges-python"
}
        
Elapsed time: 0.22560s