Skip to main content

SDK for Agave

Project description

A simple Python binding for the Agave API.

Installation

Install from PyPI:

pip install agavepy

Using agavepy in Docker

This repository includes a Dockerfile and a docker-compose.yml file, which allows a zero installation version of agavepy.

The only requirement is Docker and docker-compose, most likely already installed in your system.

Then, clone this repository and execute docker-compose as follows:

$ git clone https://bitbucket.org/taccaci/agavepy.git
$ cd agavepy
$ docker-compose build
$ docker-compose up

(a bug in docker-compose is preventing to run just up. The steps build and up have to be done separately.) Navigate to http://localhost:8888 and access the Jupyter notebook with password agavepy. The notebook Example.ipynb contains a full example of use.

Quickstart

The first step is to create an agave Python object pointing to your tenant:

>>> from agavepy.agave import Agave
>>> my_agave = Agave(api_server='https://agave.iplantc.org',
...                  username='myusername', password='mypassword')

Once the object is instantiated, interact with it according to the methods in the API documentation.

For example, create a new client with:

>>> my_agave.clients.create(body={'clientName': 'my_client'})

Access any endpoint with:

>>> my_agave.systems.list()
>>> my_agave.jobs.manage(...)

Once a client is created, it is used by default to access the API.

To make use of an existing client, pass the client’s credentials into the Agave constructor:

>>> from agavepy.agave import Agave
>>> my_agave = Agave(api_server='https://agave.iplantc.org',
...                  username='myusername', password='mypassword', client_name='my_client', api_key='123', api_secret='abc')

Alternatively, the SDK will attempt to recover the client credentials from the client name if they are stored in the user’s .agavepy file, in which case just passing the client_name will suffice:

>>> from agavepy.agave import Agave
>>> my_agave = Agave(api_server='https://agave.iplantc.org',
...                  username='myusername', password='mypassword', client_name='my_client')

License

Agavepy is licensed under the MIT license.

Swagger.py is copyright of Digium, Inc., and licensed under BSD 3-Clause License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agavepy-0.2.tar.gz (46.8 kB view details)

Uploaded Source

Built Distribution

agavepy-0.2-py2.py3-none-any.whl (52.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file agavepy-0.2.tar.gz.

File metadata

  • Download URL: agavepy-0.2.tar.gz
  • Upload date:
  • Size: 46.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for agavepy-0.2.tar.gz
Algorithm Hash digest
SHA256 05f5b5ad974b3ac5969c4646a0db1bacaf66a11cf89f7c749468fd5a36a80ab3
MD5 88d79fd9953c3f87834531ec3855149a
BLAKE2b-256 fa01d7760a9570c358be307667784702059789af9858f7e480eb5307545695bb

See more details on using hashes here.

Provenance

File details

Details for the file agavepy-0.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for agavepy-0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e56ddc14d7629a6bdc6863edc8a7c31191c288536296716aaafb01d18c73c52b
MD5 bcfa761fb33aeb304d322e27b174f676
BLAKE2b-256 a33d1d7c4c90de2555698e30833e48feeedd77a6a940dd14e100c391eaefc8f8

See more details on using hashes here.

Provenance

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