Skip to main content

optionsview

This library downloads option chain data for a given symbol from yahoo finance.

The library retrieves call and put data for the expiration dates and strikes available through yfinance.

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 = r"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()

These tests download live data and delete existing files in testing/exports before running.

Acknowledgements

This project makes use of the yfinance library.

Metadata

Release files for optionsview 0.0.5

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.5
File Size Uploaded Provenance Actions
optionsview-0.0.5.tar.gz 21.6 kB Without provenance Details for optionsview-0.0.5.tar.gz

Built distribution (wheel)

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

Total release size: 43.7 kB

Release files / optionsview-0.0.5.tar.gz

Download URL optionsview-0.0.5.tar.gz
Size 21.6 kB
Tags Source
SHA-256 checksum
How to use checksums
decb3c7cb22d06b4f58d06ffcdd39000a40d8c45c40b0deebe4e7240009f1a4f
BLAKE2b-256 checksum
How to use checksums
0b9d06f4003f3bdcbc17ba920be2c5e0a131acb5d5e8efa636fec6d150fbc3d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

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

Download URL optionsview-0.0.5-py3-none-any.whl
Size 22.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e0f955e6d8f21c00d5b6f344799a733b7fbe7ed92b5ed1a0949470726ef5c8d2
BLAKE2b-256 checksum
How to use checksums
c1c8e9ad961168c552bf51561f20b1eba1e7fb6f5252620bb12f0adb3963fd02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Security for optionsview 0.0.5

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.

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