Skip to main content

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.

  • 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.

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

optionsview-0.0.3.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

optionsview-0.0.3-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file optionsview-0.0.3.tar.gz.

File metadata

  • Download URL: optionsview-0.0.3.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.2

File hashes

Hashes for optionsview-0.0.3.tar.gz
Algorithm Hash digest
SHA256 196ba2bb3e9655423c075cce99ff6636a8ccae0955e877b09df4feed35d51ea8
MD5 dc35d6df00eb86deaf4f3a4ae616c848
BLAKE2b-256 5ed2bc5c5519f4ca173a1569c7a80cdc431856b7b4709d17c3c121d725404773

See more details on using hashes here.

File details

Details for the file optionsview-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: optionsview-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.2

File hashes

Hashes for optionsview-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 907a05da26944c4a1a9bcc09a1359b3bd07cdcd5c0e3ad630d42a59f9a43016d
MD5 102cb9faab4a399f3f07ee5a0bdb1764
BLAKE2b-256 54d20a583d4e7557af3b2cf9a4919b448f119eed7d828932df8998b47e59bf4b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page