Python wrapper for Quantopian's Aqueduct API
Project description
AqueductClient is a simple Python wrapper around Quantopian’s Aqueduct API. It lets you easily create Pipeline executions and load their results.
AqueductClient supports Python 2.7 and Python 3.4+.
Installation
$ pip install git+https://git@github.com/quantopian/aqueduct-client.git
Configuration
To use AqueductClient, you need a Quantopian API Key. Once you have it, there are several ways to use it:
Use a credentials file: create ~/.quantopian/credentials (Linux or OS X) or %UserProfile%\.quantopian\credentials (Windows) and put the following in it:
[default] API_KEY = your_api_key
Use an environment variable: set QUANTOPIAN_API_KEY to your API key.
Pass your API key directly into the create_client method (see below) using the api_key kwarg.
Usage
Note: Fuller documentation will be coming soon.
To use AqueductClient, create an instance. In this case, we are loading credentials from disk or environment variable.
from aqueduct_client import create_client
client = create_client()
To run a new pipeline execution, use submit_pipeline_execution. Required parameters are code (string), start_date and end_date (date-like strings, dates, or Pandas timestamps). Optional parameters are name (string), params (a dict of parameters to pass to your pipeline), and asset_identifier_format (which can be “symbol” (default), “sid”, and “fsym_region_id”). submit_pipeline_execution returns an id, which you can pass to get_pipeline_execution to monitor this pipeline’s execution status.
get_all_pipeline_executions and get_pipeline_execution(id) let you load existing pipelines. Each pipeline has a status field, which can be IN-PROGRESS, SUCCESS, or FAILED.
For a successful pipeline, get_pipeline_results_dataframe(id) loads that pipeline’s results into a pandas DataFrame. For a failed pipeline, get_pipeline_execution_error(id) shows you the information about the error.
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
File details
Details for the file aqueduct-client-0.1.1.tar.gz
.
File metadata
- Download URL: aqueduct-client-0.1.1.tar.gz
- Upload date:
- Size: 25.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e4b2a1a0f5b3cbdeaac1f99fed9bddd38702db82439f21c8d450c12ad8f4a06 |
|
MD5 | 172aa6650fbb76ce054556cc25d69028 |
|
BLAKE2b-256 | 436ab43f79b4c821a8f60d4164c2e6f4440933405384cc3ea6e3cb6cd3fe2f7d |