StockDataManager
This Python library offers a comprehensive suite of tools for technical and fundamental analysis, along with options analysis capabilities. Utilizing the yfinance library, it facilitates access to historical stock data, financial statements, and key financial metrics from Yahoo Finance. It includes over 30 technical indicators and options analysis tools.
Features
- Technical Analysis (
IndicatorCalculatorClass): Offers over 30 technical indicators like Moving Averages, MACD, Bollinger Bands, RSI, Ichimoku Cloud, etc., for analyzing market trends and volatility. - Fundamental Analysis (
FetcherClass): Retrieve historical stock data, income statements, balance sheets, cash flows, and key financial ratios (e.g., P/E, ROE, current ratio). - Options Analysis (
GreeksandOptionPricingClasses): tools to calculate options greeks and simulate option prices using various models, with enhanced methods to estimate risk-free rates and volatility.
Installation
pip install stockdatamanager
Quick Start
from stockdatamanager import Fetcher, IndicatorCalculator
from stockdatamanager.options import Greeks, OptionPricing
# Fetching stock data and financial statements
fetcher = Fetcher(ticker='AAPL')
print(fetcher.get_pe_ratio())
# Applying technical analysis
indicators = IndicatorCalculator(dataframe=fetcher.df)
df_with_rsi = indicators.calculate_RSI()
# Calculating options Greeks
greeks = Greeks(ticker = 'AAPL', call = True, identification = 0)
delta = greeks.calculate_delta()
# Pricing an American-style option using the binomial tree method
option_pricing = OptionPricing(ticker='MSFT', call=False, american=True, risk_free_rate='13 weeks', identification=0, use_yfinance_volatility=True)
option_price = option_pricing.calculate_option_price(method='binomial', describe=False)
print(f"Option Price: {option_price}")
Usage
Fetching Data
fetcher = Fetcher(ticker='AAPL')
income_statement = fetcher.get_income_statement()
Calculating Technical Indicators
transform = Transform(ticker='AAPL')
df_with_macd = transform.calculate_MACD()
Option Analysis
Calculate the Delta of an option:
greeks = Greeks(ticker='AAPL', call=True, identification='AAPL220121C00100000')
print(greeks.calculate_delta())
Simulate option pricing using the Crank-Nicholson method:
option_pricing = OptionPricing(ticker='MSFT', call=False, american=True, risk_free_rate='13 weeks', identification='AAPL220121C00100000', use_yfinance_volatility=True)
option_price = option_pricing.calculate_option_price(method='crank-nicolson', describe=False)
print(f"Crank-Nicolson Method Option Price: {option_price}")
Contributions
Contributions are welcome! Feel free to open an issue or submit a pull request for improvements or new features.
License
stockdatamanager is made available under the MIT License. See the LICENSE file for more details.
Contacts
Metadata
Release files for stockdatamanager 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| stockdatamanager-1.1.2.tar.gz | 35.1 kB | Without provenance | Details for stockdatamanager-1.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| stockdatamanager-1.1.2-py3-none-any.whl | Python 3 | none | any | Details for stockdatamanager-1.1.2-py3-none-any.whl |
Total release size: 69.9 kB
Release files / stockdatamanager-1.1.2.tar.gz
| Download URL | stockdatamanager-1.1.2.tar.gz |
|---|---|
| Size | 35.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b4e686e7e04f31b6e18e50861d79f57d90c0b7f3dffa05f5dd5ef715bc70e9bc
|
|
BLAKE2b-256 checksum How to use checksums |
a2b64b2441481c75b74e27ad784b086a962114bab3142706ef2c8f2077da1855
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.19
|
Release files / stockdatamanager-1.1.2-py3-none-any.whl
| Download URL | stockdatamanager-1.1.2-py3-none-any.whl |
|---|---|
| Size | 34.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0f0856b85d93fa688a344c84063712dfe527bab8340efc58ded671affb90e0bc
|
|
BLAKE2b-256 checksum How to use checksums |
bd33a37ebff7bb9bfcfeede278f24ff419cde416adb6a85d85d2f90670a2ce5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.19
|
Security for stockdatamanager 1.1.2
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.