# 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](https://github.com/ranaroussi/yfinance) library.
Raw data
{
"_id": null,
"home_page": "https://github.com/zq99/optionsview",
"name": "optionsview",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "OPTIONS,STRADDLE,DATA,TRADING,CALLS,PUTS,ALGOTRADING,YFINANCE,YAHOO FINANCE,EXPIRATION DATES,SPREADS,STOCK MARKET,TICKER",
"author": "zq99",
"author_email": "zq99@hotmail.com",
"download_url": "https://files.pythonhosted.org/packages/39/70/e62772a982569277fedfc3caf5a73b77967a99714de8a8e249742e85d362/optionsview-0.0.4.tar.gz",
"platform": null,
"description": "# optionsview\r\n\r\nThis library downloads option chain data for a given symbol from yahoo finance.\r\n\r\nThe data includes Calls and Puts for all future expiration dates and strike prices.\r\n\r\nThere are two formats provided:\r\n\r\n- Straddle view: Call and Put data for the same expiration and strike is side by side.\r\n\r\n- Stacked view: Call and Put data is stacked together.\r\n\r\n\r\n## Installation\r\n\r\nThe library requires Python 3.7 or later. \r\n \r\nTo install, type the following command on the python terminal:\r\n\r\n pip install optionsview\r\n \r\n \r\n## Implementation\r\n\r\nHere is a basic example of how to download options straddle view data:\r\n\r\n from options.data import download_options_view\r\n \r\n download_options_view('TSLA')\r\n\r\nThe following is an example of downloading the Call and Put data in a stacked format.\r\n\r\n from options.data import download_options_view, View\r\n \r\n folder = 'C:\\Users\\work\\Documents'\r\n download_options_view('TSLA', View.STACKED, folder)\r\n \r\nTo read the data into dataframes (and not create files) you can do the following:\r\n\r\n from options.data import get_options_view_df\r\n\r\n straddle_df, stacked_df = get_options_view_df('TSLA')\r\n\r\n print(straddle_df.head())\r\n print(stacked_df.head())\r\n \r\n\r\n## Examples\r\n\r\nThe folder 'samples' in this repository, has some examples of the output from the library.\r\n\r\n\r\n## Contributions\r\n\r\nContributions are welcome, all modifications should come with appropriate tests.\r\n\r\nAll tests can be run by doing the following:\r\n\r\n from testing.tests import run_all_tests\r\n run_all_tests()\r\n\r\n## Acknowledgements\r\n\r\nThis project makes use of the [yfinance](https://github.com/ranaroussi/yfinance) library.\r\n",
"bugtrack_url": null,
"license": "GPL-3.0+",
"summary": "Download options call/put data for any ticker in a trader friendly format",
"version": "0.0.4",
"project_urls": {
"Homepage": "https://github.com/zq99/optionsview"
},
"split_keywords": [
"options",
"straddle",
"data",
"trading",
"calls",
"puts",
"algotrading",
"yfinance",
"yahoo finance",
"expiration dates",
"spreads",
"stock market",
"ticker"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bd3d9cd4e42ad897a763d6bfb35c62f9717096bee6b8a32205d415c3068596df",
"md5": "443e6b3d758f58275ee35b7b9c3c3e22",
"sha256": "d9d3dd967921973d97a727ccfc04db6099d5b3d98fa77b04707ed3324740d109"
},
"downloads": -1,
"filename": "optionsview-0.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "443e6b3d758f58275ee35b7b9c3c3e22",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 19988,
"upload_time": "2024-01-24T13:34:42",
"upload_time_iso_8601": "2024-01-24T13:34:42.245013Z",
"url": "https://files.pythonhosted.org/packages/bd/3d/9cd4e42ad897a763d6bfb35c62f9717096bee6b8a32205d415c3068596df/optionsview-0.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3970e62772a982569277fedfc3caf5a73b77967a99714de8a8e249742e85d362",
"md5": "1912857691508c867c01a18ecc8532c5",
"sha256": "767df0cc6ab2654649079465b8a30d00d1be5084956aefd9378efd8403531cf1"
},
"downloads": -1,
"filename": "optionsview-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "1912857691508c867c01a18ecc8532c5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 18640,
"upload_time": "2024-01-24T13:34:50",
"upload_time_iso_8601": "2024-01-24T13:34:50.095972Z",
"url": "https://files.pythonhosted.org/packages/39/70/e62772a982569277fedfc3caf5a73b77967a99714de8a8e249742e85d362/optionsview-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-24 13:34:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "zq99",
"github_project": "optionsview",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "optionsview"
}