Skip to main content

A CLI tool to calculate Black-Scholes Greeks for options pricing.

Project description

Quant Greeks CLI Tool

CI

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_type is "call" or "put"
  • --S is the current stock price
  • --K is the strike price
  • --T is time to maturity (in years)
  • --r is the annual risk-free rate (decimal)
  • --sigma is 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: Choose binomial or black-scholes (default is black-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: --model and --steps
  • All previous Black-Scholes functionality remains unchanged

Contributing

  1. Fork the repo and create your feature branch:
    git checkout -b feature/YourFeature
    
  2. Commit your changes and push:
    git commit -m "Describe your feature"
    git push origin feature/YourFeature
    
  3. 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

quant_greeks_cli-1.1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quant_greeks_cli-1.1.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

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

Hashes for quant_greeks_cli-1.1.0.tar.gz
Algorithm Hash digest
SHA256 2bda5e041664bc55b9433d2e6d9c744d6fab8374b4f9e97665f57021c210e890
MD5 49e9b42d32cdc7ae7e5d7106eb694c89
BLAKE2b-256 0fc3ba77af8f19b4ffca2098160ba76ef4628b3bb2767abc9588c9c7ed97be82

See more details on using hashes here.

File details

Details for the file quant_greeks_cli-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for quant_greeks_cli-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 06abac890da1860e5ec51f1f684e4dd1621d447a52fdb2e9537fd8750b5417bf
MD5 c07b1d186d6e76093eb675add174b7b3
BLAKE2b-256 7aadddd6b3bd32d3d9d1dd6a524832747e242eb2ac938c6dd74ff0717543d772

See more details on using hashes here.

Supported by

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