Skip to main content

optionsview

This library downloads option chain 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.

  • Stacked 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 Call and Put data in a stacked format.

from options.data import download_options_view, View

folder = 'C:\Users\work\Documents'
download_options_view('TSLA', View.STACKED, 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, stacked_df = get_options_view_df('TSLA')

print(straddle_df.head())
print(stacked_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.

Metadata

Release files for optionsview 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for optionsview 0.0.4
File Size Uploaded
optionsview-0.0.4.tar.gz 18.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for optionsview 0.0.4
File Interpreter ABI Platform
optionsview-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 38.6 kB

Release files / optionsview-0.0.4.tar.gz

Download URL optionsview-0.0.4.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
767df0cc6ab2654649079465b8a30d00d1be5084956aefd9378efd8403531cf1
BLAKE2b-256 checksum
How to use checksums
3970e62772a982569277fedfc3caf5a73b77967a99714de8a8e249742e85d362
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / optionsview-0.0.4-py3-none-any.whl

Download URL optionsview-0.0.4-py3-none-any.whl
Size 20.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d9d3dd967921973d97a727ccfc04db6099d5b3d98fa77b04707ed3324740d109
BLAKE2b-256 checksum
How to use checksums
bd3d9cd4e42ad897a763d6bfb35c62f9717096bee6b8a32205d415c3068596df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page