Simple client for Barchart OnDemand REST APIs
Project description
Python client for Barchart OnDemand
Get access to market data and the OnDemand APIs in just a few lines of code.
Installation
From pypi
pip install ondemand
From Source
python setup.py install
Usage
import ondemand
od = ondemand.OnDemandClient(api_key='CHANGE_ME')
# or if you are using a free sandbox API
od = ondemand.OnDemandClient(api_key='CHANGE_ME', end_point='https://marketdata.websol.barchart.com/')
# if you want data in a format other than json. xml also supported
od = ondemand.OnDemandClient(api_key='CHANGE_ME', format='csv')
# get quote data for Apple and Microsoft
quotes = od.quote('AAPL,MSFT')['results']
for q in quotes:
print('Symbol: %s, Last Price: %s' % (q['symbol'], q['lastPrice']))
# get 1 minutes bars for Apple
resp = od.history('AAPL', 'minutes', maxRecords=50, interval=1)
# generic request by API name
resp = od.get('getQuote', symbols='AAPL,EXC', fields='bid,ask')
# or, get the crypto
resp = od.crypto('^BTCUSD,^LTCUSD')
Interactive Python Notebook Example
https://colab.research.google.com/drive/1D8389Q8qQzbppqFxwpUOobheZ2jb3Gp4
Version
- 1.0 - 7/27/2017 -- init
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
ondemand-1.1.1.tar.gz
(3.7 kB
view details)
Built Distribution
File details
Details for the file ondemand-1.1.1.tar.gz
.
File metadata
- Download URL: ondemand-1.1.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81711ed63c29e2e556edd4238ab4fa76d3bd29b99b81a82b358d4fc45be74c28 |
|
MD5 | 397a4367256c1d0c6ec91200c26c3bc6 |
|
BLAKE2b-256 | 227a9f530f2281fdffd5e70e5f81edda4109f070661bda7f3172931794bc8e81 |
File details
Details for the file ondemand-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: ondemand-1.1.1-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09de3ab777f96057298e0be06d50627ca8ed0721ceb8a677f6b894054cdc7520 |
|
MD5 | 6f7543f6e54f080f5cdb5ff967bf3a35 |
|
BLAKE2b-256 | 0b39eb825d40a02f45e75703337b0fecb6c7f92f9a13de8713d65897ac890fc5 |