Python library for interacting with the Velo Data API
Project description
velo-python
Python library for Velo API access. See full documentation here.
Install
pip install velodata
Usage
from velodata import lib as velo
# new velo client
client = velo.client('api_key')
# get futures and pick one
future = client.get_futures()[0]
# get futures columns and pick two
columns = client.get_futures_columns()[:2]
# last 10 minutes in 1 minute resolution
params = {
'type': 'futures',
'columns': columns,
'exchanges': [future['exchange']],
'products': [future['product']],
'begin': client.timestamp() - 1000 * 60 * 11,
'end': client.timestamp(),
'resolution': 1
}
# returns dataframe
print(client.get_rows(params))
Streaming rows
Row requests are broken up into batches past a certain size. If you don't want to wait for all your requests to finish before receiving any data, you can use this:
batches = client.batch_rows(params)
for df in client.stream_rows(batches):
print(df)
License
Copyright 2023 Velo Data, license MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
velodata-0.1.2.1.tar.gz
(3.6 kB
view hashes)
Built Distribution
Close
Hashes for velodata-0.1.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccb615aa009dc9c1828e8388b586ba634706183eac6d19f67866806d58e25803 |
|
MD5 | ea1448eeb43e2b65628ee9d2fd11da51 |
|
BLAKE2b-256 | 1d2d4e03e5bf891ade0d342943ccf97ff0d3778b2a786f1ee4d201fb859d6345 |