..
Project description
Idiomatic way for Python developers to integrate with Alfredo services.
1 Installation
On most systems, you can use pip (recommended):
# Make sure we have an up-to-date version of pip and setuptools:
pip install --upgrade pip setuptools
pip install alfredo-python
Both Python 2 and 3 are supported.
2 Command Line Interface Usage
The main command to interact with Alfredo stack is alfredo.
Input is expected to be in YAML format, and also the output is serialized in that way.
You can set RUOTE_ROOT and/or VIRGO_ROOT env vars to point the CLI and the SDK to your desired installation of the Alfredo stack.
After that, you can execute alfredo to get the usage help.
You can also execute alfredo -help to get an updated list of the options you have, with examples.
3 Python Software Development Kit
The main module you need to import to interact with the Alfredo stack is alfredo.
The main functions of the module are the ruote and virgo ones, to get the client object to further interact with respective services.
You can use alfredo.ruote() to get annonymous access to the open endpoints in Ruote. The same applies for virgo.
For instance, you can use the annonymous access to get a token given an email and a password.
Please feel free of using the Python console to get used to the SDK prior to using it in real Python code.
>>> alfredo.ruote().sso.token_by_email.create(email='alice@example.com', password='*******')
400 - Bad Request
non_field_errors:
- Unable to log in with provided credentials.
>>> alfredo.ruote().sso.token_by_email.create(email='alice@example.com', password='********')
200 - OK
token: b1cff2aab075744ddda6b00805617f561e940107
You can use alfredo.ruote(token='b1cff2aab075744ddda6b00805617f561e940107') to get an authenticated client against Ruote.
>>> alfredo.ruote(token='b1bff2aab075744ddda6b00805617f561e940107')
200 - OK
AWSclusters: http://api.teamjamon.com/AWSclusters/
apps: http://api.teamjamon.com/apps/
clusters: http://api.teamjamon.com/clusters/
datasets: http://api.teamjamon.com/datasets/
files: http://api.teamjamon.com/files/
jobs: http://api.teamjamon.com/jobs/
queues: http://api.teamjamon.com/queues/
users: http://api.teamjamon.com/users/
vdcs: http://api.teamjamon.com/vdcs/
Most of the functions mimic the url structure of the http API, and receives named parameters as input.
Please refer to the Alfredo API documentation for further details.
4 Development
You can create your fork of the repo before making any change.
Never forget to install the requirements first if you are using an isolated virtualenv: pip install -r requirements.txt
And to include the test requirements if you are planning to pass the tests locally pip install -r requirements-test.txt
You can run the tests using nosetests --with-coverage --cover-package=alfredo --stop
Currently, the main branch is develop because the code is still in beta. You can make PRs against develop.
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
File details
Details for the file alfredo-python-0.0.8.tar.gz
.
File metadata
- Download URL: alfredo-python-0.0.8.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eff62cd27b110b06d7619a627c2523a53d3b42214540aec012fe74d3234904a0 |
|
MD5 | f4f7dc8cf60f4a4e4ebb7ae952a7e4b0 |
|
BLAKE2b-256 | 19233824ffd6083a6ae78764a24d551bc32c343f9ef6f22fcf65525b10e0da80 |
File details
Details for the file alfredo_python-0.0.8-py2.py3-none-any.whl
.
File metadata
- Download URL: alfredo_python-0.0.8-py2.py3-none-any.whl
- Upload date:
- Size: 22.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9bc2b89d8a69b68fecfae2a444c28c4325e9e50c9fcc30edf6bdb640f464b70 |
|
MD5 | 9f60fbe76b044f2b5d06d9419b7a65fb |
|
BLAKE2b-256 | 26deb6405d3dc9115cce1969a9afee0f92920cc6ceb9abe889ad346286dcbd18 |