Skip to content

tpqps is a wrapper package for the streaming API of Plotly.

License

Notifications You must be signed in to change notification settings

yhilpisch/tpqps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Python Quants

tpqps

Streaming Plots with Plotly

tpqps is a wrapper class for the streaming API of http://plot.ly.

The package is authored and maintained by The Python Quants GmbH. © Dr. Yves J. Hilpisch. MIT License.

Disclaimer

The tpqps package is intended as a technological illustration only. It comes with no warranties or representations, to the extent permitted by applicable law.

Installation

Installing from source via Git and Github:

git clone https://github.com/yhilpisch/tpqps
cd tpqps
python setup.py install

Using pip in combination with Github:

pip install git+git://github.com/yhilpisch/tpqps

Connection

In order to connect to the API, you need to have an account with Plotly (https://plot.ly). Once logged in to you account, you can create an API key and ans streaming API tokens. These are expected to be stored in a configuration file, with a filename of plotly.cfg, for instance, as follows:

[plotly]
user_name = user_name_...
api_key = api_key_...
api_tokens = token1,token2,token3,token4,...

You can then create a streaming plot object as follows.

import tpqps
ps = tpqps.tpqps('plotly.cfg', 'Plot Title')
[_ for _ in ps.__dir__() if not _.startswith('__')]
['user_name',
 'api_key',
 'api_tokens',
 'sources',
 'source_id',
 'traces',
 'data',
 'maxpoints',
 'token_number',
 'context',
 'poller',
 'title',
 'cols',
 'rows',
 'subplots',
 'layout',
 'plot_url',
 'fig',
 'init_plot',
 'add_layout',
 'add_data_source',
 'add_trace',
 'set_max_points',
 'get_plot_url',
 'start_streaming',
 'add_socket',
 'set_subplot_title',
 'set_subplot_specs']

Documentation

More details will follow that describe the usage of tpqps.

The Python Quants

http://tpq.io | @dyjh | training@tpq.io

About

tpqps is a wrapper package for the streaming API of Plotly.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published