Idiomatic way for Python developers to integrate with Alfredo services.
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.
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.
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(firstname.lastname@example.org', password='*******') 400 - Bad Request non_field_errors: - Unable to log in with provided credentials. >>> alfredo.ruote().sso.token_by_email.create(email@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.
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.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size alfredo_python-0.0.8-py2.py3-none-any.whl (22.5 kB)||File type Wheel||Python version py2.py3||Upload date||Hashes View|
|Filename, size alfredo-python-0.0.8.tar.gz (10.1 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for alfredo_python-0.0.8-py2.py3-none-any.whl