Skip to main content

Compute first-, second-, and third-order option Greeks.

Project description

greeks-package

Black-Scholes option Greeks made easy

Compute first-, second-, and third-order Greeks for European options in a single line of code. A tiny helper fetches an option chain from Yahoo! Finance, and pure-Python utilities give you Δ, Γ, Vega, Vanna, Color, and more – no external Greeks library required.


Installation

# From PyPI (when published)
pip install greeks-package

# From local source (editable mode)
cd GreeksFolderJune
pip install -e .

Requires Python ≥ 3.9 and pulls in NumPy, Pandas, SciPy, yfinance, and Plotly automatically.


Quick-start

import greeks_package as gp

# 1️⃣  Pull a filtered option chain (calls within ±5 % moneyness, ≤30 d expiry)
chain = gp.download_options("AAPL", opt_type="c", max_days=30,
                            lower_moneyness=0.95, upper_moneyness=1.05)

# 2️⃣  Compute all Greeks for each row in one shot
all_greeks = chain.apply(gp.greeks, axis=1, ticker="AAPL")

# 3️⃣  Combine & inspect
full = chain.join(all_greeks)
print(full.head())

Public API – top-level helpers

Helper Description
download_options Fetch & filter option chain from Yahoo! Finance
first_order Δ, Vega, Θ, Rho
second_order Γ, Vanna, Volga, Veta, Charm
third_order Color, Speed, Ultima, Zomma
greeks Convenience = first + second + third
help Interactive cheat-sheet (gp.help())

All six names above are re-exported in the package root:

from greeks_package import download_options, first_order, second_order,
                          third_order, greeks, help

Low-level building blocks

Need finer control? Import directly from greeks_package.core:

from greeks_package.core import (
    compute_d1, compute_d2, compute_d1_d2,   # Black-Scholes internals
    vanna, volga, charm, veta,               # second-order Greeks
    color, speed, ultima, zomma,             # third-order Greeks
)

Each function follows the same signature (row, ticker, r=0.05, option_type='c', epsilon=1e-9) and returns a float.


Interactive help

import greeks_package as gp

gp.help()                       # prints cheat-sheet & quick-start

gp.help(gp.second_order)        # deep-dive on a specific helper

For an in-depth tutorial covering edge cases, recipes, and API stability, see USAGE.md.


© 2025 JR Concepcion. Licensed under the MIT License.

import greeks_package as gp

# pull a filtered option chain
chain = gp.download_options("AAPL", opt_type="c")

# compute all greeks for each row
full = chain.join(chain.apply(gp.greeks, axis=1, ticker="AAPL"))
print(full.head())

Built with NumPy, Pandas, SciPy, yfinance, and Plotly.

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

greeks_package-0.2.1.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

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

greeks_package-0.2.1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file greeks_package-0.2.1.tar.gz.

File metadata

  • Download URL: greeks_package-0.2.1.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for greeks_package-0.2.1.tar.gz
Algorithm Hash digest
SHA256 6f59c16a408ff001a816c74bc8dd53f5c3e9c708654ff3f312e5436b0eff93c5
MD5 b91d52355cda2fee351996e29fd57edd
BLAKE2b-256 005bec5361ea8ac8167f700201516a638a009856a6c36f2209e6f4476e91b908

See more details on using hashes here.

File details

Details for the file greeks_package-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: greeks_package-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for greeks_package-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c212ea2de3c5aadeecf8ad3551e2d4a0681550eafdda8d82f7eb58e57a98dd0b
MD5 1c40e9fc0ce93a06e7fdb0f876a71e6f
BLAKE2b-256 0ab494e1153aa03aa6537f2e61244e65daf6e78121f7becb3d95f618913d81d3

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