Most of the AmigoCloud backend is implemented in Python. So it make sense that we will have a Python client.
Before you keep reading this article, make sure you read about how to generate API tokens, because we will use these tokens here.
If you're a bit familiarized with Python you know what PyPI is. For those who don't, PyPI is the Python Package Index, and there you can find the AmigoCloud Python client (link here).
Most of the documentation is therealready, but just as a small summary:
Installation
Installing the client is as simple as doing:
pip install amigocloud
Authentication
This client uses API tokens to authenticate you, like this:
from amigocloud import AmigoCloud amigocloud = AmigoCloud(token='A:••••••••••••••••')
Usage
Once you have authenticated, you can do all type of requests. A couple of examples here:
- Access your user data
amigocloud.get('me')
- Create a new project (needs ADMIN permission)
data = {'name': 'Project created from Python'} amigocloud.post('me/projects', data)
- Query data
data = {'query': 'SELECT * FROM dataset_123'} amigocloud.get('users/1/projects/2/sql', data)
Comments
0 comments
Please sign in to leave a comment.