barchart
The Unofficial API for barchart.com
Installation
pip install barchart
Unusual Options Activity
from barchart import UOA
uoa = UOA()
uoa.data
[
{'Symbol': 'TGT', 'Price': '153.78', 'Type': 'Call', 'Strike': '160.00', 'Exp Date': '08/28/20', 'DTE': '9', 'Bid': '1.53', 'Midpoint': '1.55', 'Ask': '1.56', 'Last': '1.40', 'Volume': '7,382', 'Open Int': '165', 'Vol/OI': '44.74', 'IV': '38.08%', 'Delta': '50', 'Last Trade': '13:19 ET'},
]
#Create CSV file
uoa.to_csv()
#Options
uoa = UOA(timeout=100, user_agent='whatever user agent you want to use')
Concerns
The first time you ever run the render() method, it will download Chromium into your home directory (e.g. ~/.pyppeteer/). This only happens once. Additional necessary linux packages may need to be installed.
You have the option to pass in your own user in UOA(user_agent='Chrome...')
Sometimes barchart will limit the amount of results based on what type of user agent you are using.
Timeout issues do sometimes occur when fetching with asycnc since data is loaded onto the DOM asynchronous.
A Timeout Exception will be raised barchart.helpers.errors.TimeoutError
At the moment, it takes about 1 minute to fetch and parse 10-12 pages.
If a parsing exception is raised, look at the above exception which ouputs the html in text. If the html response looks correct and the exception is still
persisting, please create a issue ticket.
Parsing exceptions barchart.helpers.errors.ParsingError: Parsing error: Index error on table headers, check html response above
Sometimes barchart likes to suppress most of their data at different times of day.
Metadata
Release files for barchart 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| barchart-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for barchart-0.1.4-py3-none-any.whl |
Release files / barchart-0.1.4-py3-none-any.whl
| Download URL | barchart-0.1.4-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
516dd797e646adbcaa45ac43f52061a15a539d63ac802d4f31e72329c5e1e941
|
|
BLAKE2b-256 checksum How to use checksums |
82f651892adc5f73f4dea08375901e4fb3721027523158f127db9618499928ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.0
|
Security for barchart 0.1.4
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.