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
Metadata
Release files for ondemand 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ondemand-1.1.1.tar.gz | 3.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ondemand-1.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.6 kB
Release files / ondemand-1.1.1.tar.gz
| Download URL | ondemand-1.1.1.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
81711ed63c29e2e556edd4238ab4fa76d3bd29b99b81a82b358d4fc45be74c28
|
|
BLAKE2b-256 checksum How to use checksums |
227a9f530f2281fdffd5e70e5f81edda4109f070661bda7f3172931794bc8e81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / ondemand-1.1.1-py3-none-any.whl
| Download URL | ondemand-1.1.1-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
09de3ab777f96057298e0be06d50627ca8ed0721ceb8a677f6b894054cdc7520
|
|
BLAKE2b-256 checksum How to use checksums |
0b39eb825d40a02f45e75703337b0fecb6c7f92f9a13de8713d65897ac890fc5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for ondemand 1.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.