Metadata-Version: 2.4
Name: optionsview
Version: 0.0.5
Summary: Download options call & put data for any ticker in a trader friendly format
Home-page: https://github.com/zq99/optionsview
Author: zq99
Author-email: zq99@hotmail.com
License: GPL-3.0+
Keywords: OPTIONS,STRADDLE,DATA,TRADING,CALLS,PUTS,ALGOTRADING,YFINANCE,YAHOO FINANCE,EXPIRATION DATES,SPREADS,STOCK MARKET,TICKER
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Education
Classifier: Operating System :: Microsoft :: Windows :: Windows 10
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: yfinance
Requires-Dist: pandas
Requires-Dist: numpy
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# 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](https://github.com/ranaroussi/yfinance) library.
