Metadata-Version: 2.0
Name: resdk
Version: 1.3.0
Summary: Resolwe SDK for Python
Home-page: https://github.com/genialis/resolwe-bio-py
Author: Genialis d.o.o.
Author-email: dev-team@genialis.com
License: Apache License (2.0)
Keywords: bioinformatics resolwe bio pipelines dataflow django python sdk
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Requires-Dist: appdirs (>=1.4.0)
Requires-Dist: requests (>=2.6.0)
Requires-Dist: six (>=1.10.0)
Requires-Dist: slumber (>=0.7.1)
Provides-Extra: docs
Requires-Dist: sphinx (>=1.4.1); extra == 'docs'
Requires-Dist: sphinx-rtd-theme (>=0.1.9); extra == 'docs'
Provides-Extra: package
Requires-Dist: twine; extra == 'package'
Requires-Dist: wheel; extra == 'package'
Provides-Extra: test
Requires-Dist: check-manifest; extra == 'test'
Requires-Dist: coverage (>=3.7.1); extra == 'test'
Requires-Dist: mock (==1.3.0); extra == 'test'
Requires-Dist: pep8 (>=1.6.2); extra == 'test'
Requires-Dist: pylint (>=1.4.3); extra == 'test'
Requires-Dist: readme-renderer; extra == 'test'

======================
Resolwe SDK for Python
======================

|build| |docs| |pypi_version| |pypi_pyversions| |pypi_downloads|

.. |build| image:: https://travis-ci.org/genialis/resolwe-bio-py.svg?branch=master
    :target: https://travis-ci.org/genialis/resolwe-bio-py
    :alt: Build Status

.. |docs| image:: https://readthedocs.org/projects/resdk/badge/?version=latest
    :target: http://resdk.readthedocs.io/
    :alt: Documentation Status

.. |pypi_version| image:: https://img.shields.io/pypi/v/resdk.svg
    :target: https://pypi.python.org/pypi/resdk
    :alt: Version on PyPI

.. |pypi_pyversions| image:: https://img.shields.io/pypi/pyversions/resdk.svg
    :target: https://pypi.python.org/pypi/resdk
    :alt: Supported Python versions

.. |pypi_downloads| image:: https://img.shields.io/pypi/dm/resdk.svg
    :target: https://pypi.python.org/pypi/resdk
    :alt: Number of downloads from PyPI


The Resolwe SDK for Python supports writing tools for Resolwe_ dataflow
package for `Django framework`_ and `Resolwe Bioinformatics`_ that
includes the bioinformatics pipelines.

.. _Resolwe Bioinformatics: https://github.com/genialis/resolwe-bio
.. _Resolwe: https://github.com/genialis/resolwe
.. _Django framework: https://www.djangoproject.com/

Docs & Help
===========

Read detailed description in the documentation_.

.. _documentation: http://resolwe-bio-py.readthedocs.io/


Install
=======

To install, run::

  pip install resdk

To install for development, run::

  pip install -e .[docs,package,test]


Usage
=====

Connect to the Resolwe server:

.. code-block:: python

   from resdk import Resolwe
   re = Resolwe('me@mail.com', 'my_password', 'www.resolwe.com')

Get all collections and select the first one:

.. code-block:: python

   collections = re.collections()
   collection = list(collections.values())[0]

Get expression objects and select the first one:

.. code-block:: python

   expressions = collection.data(type__startswith='data:expression:')
   expression = expressions[0]

Print annotation:

.. code-block:: python

   expression.print_annotation()

Print file fields:

.. code-block:: python

   expression.print_downloads()

Download file:

.. code-block:: python

   filename = expression.annotation['output.exp']['value']['file']
   file_stream = expression.download('output.exp')
   with open(filename, 'w') as f:
       for part in file_stream:
           f.write(part)


