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
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
Built Distribution
Hashes for agavepy-0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e56ddc14d7629a6bdc6863edc8a7c31191c288536296716aaafb01d18c73c52b |
|
MD5 | bcfa761fb33aeb304d322e27b174f676 |
|
BLAKE2b-256 | a33d1d7c4c90de2555698e30833e48feeedd77a6a940dd14e100c391eaefc8f8 |