{"id":37084191,"url":"https://github.com/marcdemers/py_vollib_vectorized","last_synced_at":"2026-01-14T10:17:37.199Z","repository":{"id":41282645,"uuid":"309541675","full_name":"marcdemers/py_vollib_vectorized","owner":"marcdemers","description":"A vectorized implementation of py_vollib, that supports numpy arrays and pandas Series and DataFrames.","archived":false,"fork":false,"pushed_at":"2024-12-02T23:22:23.000Z","size":288,"stargazers_count":136,"open_issues_count":15,"forks_count":35,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-08-23T07:23:30.227Z","etag":null,"topics":["finance","finance-application","greeks","implied-volatility","pandas","py-vollib","speedups","trading","trading-bot","vectorization","volatility","volatility-modeling"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcdemers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-03T01:41:49.000Z","updated_at":"2025-07-23T10:51:39.000Z","dependencies_parsed_at":"2022-07-06T19:03:06.488Z","dependency_job_id":null,"html_url":"https://github.com/marcdemers/py_vollib_vectorized","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/marcdemers/py_vollib_vectorized","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcdemers%2Fpy_vollib_vectorized","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcdemers%2Fpy_vollib_vectorized/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcdemers%2Fpy_vollib_vectorized/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcdemers%2Fpy_vollib_vectorized/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcdemers","download_url":"https://codeload.github.com/marcdemers/py_vollib_vectorized/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcdemers%2Fpy_vollib_vectorized/sbom","scorecard":{"id":617368,"data":{"date":"2025-08-11","repo":{"name":"github.com/marcdemers/py_vollib_vectorized","commit":"0c2519ff58e3caf2caee37ca37d878e6e5e1eefd"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/27 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"11 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2018-34 / GHSA-2fc2-6r4j-p65h","Warn: Project is vulnerable to: PYSEC-2021-856 / GHSA-5545-2q6w-2gh6","Warn: Project is vulnerable to: PYSEC-2019-108 / GHSA-9fq2-x9r6-wfmf","Warn: Project is vulnerable to: PYSEC-2018-33 / GHSA-cw6w-4rcx-xphc","Warn: Project is vulnerable to: PYSEC-2021-857 / GHSA-f7c7-j99h-c22f","Warn: Project is vulnerable to: GHSA-fpfv-jqm9-f5jm","Warn: Project is vulnerable to: PYSEC-2017-1 / GHSA-frgw-fgh6-9g52","Warn: Project is vulnerable to: PYSEC-2020-73","Warn: Project is vulnerable to: PYSEC-2019-156 / GHSA-xp76-357g-9wqq","Warn: Project is vulnerable to: PYSEC-2023-102","Warn: Project is vulnerable to: PYSEC-2023-114"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T04:19:53.004Z","repository_id":41282645,"created_at":"2025-08-21T04:19:53.005Z","updated_at":"2025-08-21T04:19:53.005Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28416851,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:38:59.149Z","status":"ssl_error","status_checked_at":"2026-01-14T08:38:43.588Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["finance","finance-application","greeks","implied-volatility","pandas","py-vollib","speedups","trading","trading-bot","vectorization","volatility","volatility-modeling"],"created_at":"2026-01-14T10:17:36.585Z","updated_at":"2026-01-14T10:17:37.193Z","avatar_url":"https://github.com/marcdemers.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# py_vollib_vectorized\n\n\n## Introduction\n\nThe `py_vollib_vectorized` package makes pricing thousands of option contracts and calculating greeks fast and effortless.\nIt is built on top of the `py_vollib` library.\nUpon import, it will automatically patch the corresponding `py_vollib` functions so as to support vectorization.\nInputs can then be passed as floats, tuples, lists, `numpy.array`, or `pandas.Series`.\nAutomatic broadcasting is performed on the inputs.\n\nOn top of vectorization, modifications to py_vollib include additional `numba` speedups; as such, `numba` is required.\nThese speedups make `py_vollib_vectorized` the fastest library for pricing option contracts.\n\nSee the [documentation](https://py-vollib-vectorized.readthedocs.io/en/latest) for more details.\n\n## Installation\n\n    pip install py_vollib_vectorized\n    \n## Requirements\n\n* Written for Python 3.5+\n* Requires py_vollib, numba, numpy, pandas, scipy\n\n## Code samples\n\nThe library can be used in two ways.\nUpon import, it monkey-patches (i.e. replaces) the corresponding functions in `py_vollib`.\n\nAs a more versatile alternative, users that would prefer to work with a dedicated option pricing API can make use of the utility functions provided by the library.\n\n#### Patching `py_vollib`\n\n```python\n# The usual py_vollib syntax\n\nimport numpy as np\nimport pandas as pd\n\nimport py_vollib.black_scholes\nflag = 'c'  # 'c' for call, 'p' for put\nS = 100  # Underlying asset price\nK = 90  # Strike\nt = 0.5  # (Annualized) time-to-expiration\nr = 0.01  # Interest free rate\niv = 0.2  # Implied Volatility\n\noption_price = py_vollib.black_scholes.black_scholes(flag, S, K, t, r, iv)  # 12.111581435\n\n# This library keeps the same syntax, but you can pass as input any iterable of values.\n# This includes list, tuple, numpy.array, pd.Series, pd.DataFrame (with only a single column).\n# Note that you must pass a value for each contract as *no broadcasting* is done on the inputs.\n\n\n# Patch the original py_vollib library by importing py_vollib_vectorized\nimport py_vollib_vectorized  # The same functions now accept vectors as input!\n\n# Note that the input arguments are broadcasted.\n# You can specify ints, floats, tuples, lists, numpy arrays or Series.\n\nflag = ['c', 'p']  # 'c' for call, 'p' for put\nS = (100, 100)  # Underlying asset prices\nK = [90]  # Strikes\nt = pd.Series([0.5, 0.6])  # (Annualized) times-to-expiration\nr = np.array([0.01])  # Interest free rates\niv = 0.2  # Implied Volatilities\n\noption_price = py_vollib.black_scholes.black_scholes(flag, S, K, t, r, iv, return_as='array')  \n# array([12.11158143,  2.02418536])\n```\n\n#### Utility functions\nWe also define other utility functions to get all contract prices, implied volatilities, and greeks in a single call.\n\n```python\nimport pandas as pd\nfrom py_vollib_vectorized import price_dataframe, get_all_greeks\n\n# Using the data above, we can calculate all contracts greeks in a single call\ngreeks = get_all_greeks(flag, S, K, t, r, iv, model='black_scholes', return_as='dict')\n\n#   {'delta': array([ 0.80263679, -0.21293214]),\n#    'gamma': array([0.0196385, 0.01875498]),\n#    'theta': array([-0.01263557, -0.00964498]),\n#    'rho': array([0.34073321, -0.13994668]),\n#    'vega': array([0.19626478, 0.22493816])}\n\n# We can also price a dataframe easily by specifying a dataframe and the corresponding columns\n\ndf = pd.DataFrame()\ndf['Flag'] = ['c', 'p']\ndf['S'] = 95\ndf['K'] = [100, 90]\ndf['T'] = 0.2\ndf['R'] = 0.2\ndf['IV'] = 0.2\nresult = price_dataframe(df, flag_col='Flag', underlying_price_col='S', strike_col='K', annualized_tte_col='T',\n                     riskfree_rate_col='R', sigma_col='IV', model='black_scholes', inplace=False)\n#   Price       delta       gamma       theta       rho        vega\n#   2.895588    0.467506    0.046795    -0.045900   0.083035   0.168926\n#   0.611094    -0.136447   0.025739    -0.005335   -0.027151  0.092838\n\n```\n\nSee the [documentation](https//py-vollib-vectorized.readthedocs.io/en/latest) for more details.\n\n## Benchmarking\n\nCompared to looping through contracts or to using built-in pandas functionality, this library is very memory efficient and scales fast and well to a large number of contracts.\n\n![Performance of the py_vollib_vectorized libary](docs/_static/benchmark.png \"Benchmark\")\n\n\n## Acknowledgements\n\nThis library optimizes the `py_vollib` codebase, itself built upon Peter Jäckel's *Let's be rational* methodology.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcdemers%2Fpy_vollib_vectorized","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcdemers%2Fpy_vollib_vectorized","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcdemers%2Fpy_vollib_vectorized/lists"}