A CLI tool to calculate Black-Scholes Greeks for options pricing.
Project description
Quant Greeks CLI Tool
A lightweight command-line tool for calculating the five main Black-Scholes Greeks (Delta, Gamma, Vega, Theta, Rho). Designed for traders, quants, and finance students, this tool helps you analyze options risk and sensitivity directly from your terminal.
Features
- Black-Scholes Greeks Calculator: Computes Delta, Gamma, Vega, Theta, and Rho
- Simple CLI: Run calculations from your terminal with intuitive arguments
- 100% Test Coverage: Every calculation is unit tested for accuracy
- CI/CD: Integrated with GitHub Actions for continuous testing and reliability
Installation
Install directly from PyPI:
pip install quant-greeks-cli
Or clone the repository:
git clone https://github.com/Patience-Fuglo/quant-greeks-cli.git
cd quant-greeks-cli
python3 -m venv .venv # optional but recommended
source .venv/bin/activate
pip install -r requirements.txt
pip install .
Usage
Calculate option Greeks from the CLI:
quant-greeks --option_type call --S 100 --K 100 --T 1 --r 0.05 --sigma 0.2
Where:
--option_typeis"call"or"put"--Sis the current stock price--Kis the strike price--Tis time to maturity (in years)--ris the annual risk-free rate (decimal)--sigmais volatility (decimal)
For help:
quant-greeks --help
Example
quant-greeks --option_type put --S 95 --K 100 --T 0.5 --r 0.01 --sigma 0.15
Testing
Run all tests with:
pytest
(Requires pytest, included in requirements.txt.)
Binomial Option Pricing Model (New Feature!)
This CLI now supports option pricing using both the Black-Scholes and Binomial models.
Usage Examples
Black-Scholes (default):
python cli.py --option_type call --S 100 --K 100 --T 1 --r 0.05 --sigma 0.2
Binomial model (with steps):
python cli.py --model binomial --option_type call --S 100 --K 100 --T 1 --r 0.05 --sigma 0.2 --steps 100
--model: Choosebinomialorblack-scholes(default isblack-scholes)--steps: Number of steps for the binomial tree (only used for binomial model; default = 100)
What’s New
- Add binomial model for European option pricing
- New CLI arguments:
--modeland--steps - All previous Black-Scholes functionality remains unchanged
Contributing
- Fork the repo and create your feature branch:
git checkout -b feature/YourFeature
- Commit your changes and push:
git commit -m "Describe your feature" git push origin feature/YourFeature
- Open a Pull Request.
License
MIT License
Author
Patience Fuglo
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quant_greeks_cli-1.1.0.tar.gz.
File metadata
- Download URL: quant_greeks_cli-1.1.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bda5e041664bc55b9433d2e6d9c744d6fab8374b4f9e97665f57021c210e890
|
|
| MD5 |
49e9b42d32cdc7ae7e5d7106eb694c89
|
|
| BLAKE2b-256 |
0fc3ba77af8f19b4ffca2098160ba76ef4628b3bb2767abc9588c9c7ed97be82
|
File details
Details for the file quant_greeks_cli-1.1.0-py3-none-any.whl.
File metadata
- Download URL: quant_greeks_cli-1.1.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06abac890da1860e5ec51f1f684e4dd1621d447a52fdb2e9537fd8750b5417bf
|
|
| MD5 |
c07b1d186d6e76093eb675add174b7b3
|
|
| BLAKE2b-256 |
7aadddd6b3bd32d3d9d1dd6a524832747e242eb2ac938c6dd74ff0717543d772
|