Download options call/put data for any ticker in a trader friendly format
Project description
optionsview
This library downloads options data for a given symbol from yahoo finance.
The data includes Calls and Puts for all future expiration dates and strike prices.
There are two formats provided:
-
straddle view: call and put data for the same expiration and strike is side by side.
-
tabular view: call and put data is stacked together.
Installation
The library requires Python 3.7 or later.
To install, type the following command on the python terminal:
pip install optionsview
Implementation
Here is a basic example of how to download options straddle view data:
from options.data import download_options_view
download_options_view('TSLA')
The following is an example of downloading the data in a raw tabulated dataset.
from options.data import download_options_view, View
folder = 'C:\Users\work\Documents'
download_options_view('TSLA', View.TABULAR, folder)
To read the data into dataframes (and not create files) you can do the following:
from options.data import get_options_view_df
straddle_df, tabular_df = get_options_view_df('TSLA')
print(straddle_df.head())
print(tabular_df.head())
Examples
The folder 'samples' in this repository, has some examples of the output from the library.
Contributions
Contributions are welcome, all modifications should come with appropriate tests.
All tests can be run by doing the following:
from testing.tests import run_all_tests
run_all_tests()
Acknowledgements
This project makes use of the yfinance library.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file optionsview-0.0.1.tar.gz
.
File metadata
- Download URL: optionsview-0.0.1.tar.gz
- Upload date:
- Size: 18.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ed87dd36aabedc664981dd9981b97cb2af876d1c978cd4575d683f6f69b10b4 |
|
MD5 | 0e2e467772e56e5fc3702d6659531d36 |
|
BLAKE2b-256 | 8e530034d6594e3d85c6ef83dbac556dd321081949192271f47181e759d292ee |
File details
Details for the file optionsview-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: optionsview-0.0.1-py3-none-any.whl
- Upload date:
- Size: 19.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5ced72f293fe3e060ecbef07c177c4f56478f4c1213e36bf3078534fb00ce0e |
|
MD5 | 2123832b68b0f7444b8deef574c69307 |
|
BLAKE2b-256 | f9763469293572722c2f84535ca6d58c4ae8d0e23d7dbebb5baad727195f7075 |