This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
Intuition as a REST Service

> This plugin provides a RESTFul interface to intuition


$ git clone
$ cd intuition-plugins/rest
$ (sudo) python install
$ (sudo) pip install honcho # Optionnaly

Currently the plugin searchs for portfolios data in [Rethinkdb](
Check out their installation page and [how to use it in

Usage and API

Run the server in a first console

$ # Rethinkdb informations
$ export DB_HOST=localhost
$ export DB_PORT=28015
$ export DB_NAME=portfolios
$ export BROKER_HOST=localhost
$ export BROKER_PORT=6379

$ telepathy --help
$ telepathy --bind --debug &
$ celery -A telepathy.trades worker --loglevel info

$ # Or more convenient, use the procfile in intuition-plugins/rest/app
$ honcho start -f /path/to/intuition-plugins/rest/app/Procfile

In another terminal

* Request portfolio metrics

$ curl -X GET http://localhost:5000/api/v1/doc

$ curl -X GET http://localhost:5000/api/v1/portfolios?id=chuck&
$ GET /api/v1/portfolios?id=chuck&key=cmr.algo_volatility
$ # the key is the data path (check below), the id the database table (i.e. the argument you gave to --id)

$ # You can retrieve many keys at the same time
$ GET /api/v1/portfolios?id=chuck&key=cmr.algo_volatility&

$ # Or for many portfolios
$ GET /api/v1/portfolios?id=chuck&id=gekko&key=cmr.algo_volatility

$ # Or even more informations
$ GET /api/v1/portfolios?id=chuck&key=portfolio
$ GET /api/v1/portfolios?id=chuck

$ # You can request time series given epoch times.
$ # If the "to" parameter is missing, it will be set to now
$ GET /api/v1/portfolios?id=chuck&key=portfolio.portfolio_value&from=1389183632

* Trigger backtests or live sessions

# Trigger the session
$ POST /api/v1/trades/{{ id }}?context=mongodb::{{ conf_id }}&bot=true

# Get the status
$ GET /api/v1/trades/{{ id }}

* Interact with the portfolio manager

$ # Make the portfolio buy (or sell negative)
$ # You can add as many 'deal' parameter as you want
$ POST /api/v1/order/{{ id }}?deal={{ sid }}:{{ amount }}


* The [Dashboard plugin](
uses this API

* At a specific date, intuition stores this type of data

"date": Thu Jan 09 2014 18:58:04 GMT+00:00,
"id": "08bc3177-034b-4317-9e8e-d9a160adcafc",
"positions_value": 49921.24627,
"returns": -0.023526527502224052,
"start_date": Thu Jan 09 2014 17:01:04 GMT+00:00,
"starting_cash": 50000,
"cmr": {
"algo_volatility": 0,
"algorithm_period_return": 0,
"alpha": -0.0794,
"benchmark_period_return": 1001,
"benchmark_volatility": 0,
"beta": 0,
"excess_return": -0.0794,
"information": null,
"max_drawdown": 0,
"period_label": "2014-01",
"sharpe": null,
"sortino": 0,
"trading_days": 1,
"treasury_period_return": 0.0794
"portfolio": {
"capital_used": -51097.572645111206,
"cash": -1097.572645111206,
"pnl": -1176.3263751112027,
"portfolio_value": 48823.6736248888,
"positions": {
"USD/JPY": {
"amount": 47,
"cost_basis": 104.7801341943,
"last_sale_price": 104.787,
"sid": "USD/JPY"
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
telepathy-0.0.4.tar.gz (6.4 kB) Copy SHA256 Checksum SHA256 Source Jan 24, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting