{"id":37743561,"url":"https://github.com/erkandem/calcbsimpvol","last_synced_at":"2026-01-16T14:13:08.537Z","repository":{"id":89303247,"uuid":"168404934","full_name":"erkandem/calcbsimpvol","owner":"erkandem","description":"Calculate Black Scholes Implied Volatility - Vectorwise ","archived":false,"fork":false,"pushed_at":"2021-02-10T14:19:47.000Z","size":7186,"stargazers_count":15,"open_issues_count":4,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-08T22:20:12.635Z","etag":null,"topics":["black-scholes","finance","implied-volatility","options","options-pricing","python"],"latest_commit_sha":null,"homepage":"https://erkandem.github.io/calcbsimpvol/","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/erkandem.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,"governance":null}},"created_at":"2019-01-30T19:49:05.000Z","updated_at":"2023-04-18T12:43:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"5bb2bbcb-2900-43a4-92a6-36d65b7213ef","html_url":"https://github.com/erkandem/calcbsimpvol","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/erkandem/calcbsimpvol","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erkandem%2Fcalcbsimpvol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erkandem%2Fcalcbsimpvol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erkandem%2Fcalcbsimpvol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erkandem%2Fcalcbsimpvol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erkandem","download_url":"https://codeload.github.com/erkandem/calcbsimpvol/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erkandem%2Fcalcbsimpvol/sbom","scorecard":{"id":381412,"data":{"date":"2025-08-11","repo":{"name":"github.com/erkandem/calcbsimpvol","commit":"2ccae56dce825f22c32cd89bb9506cb002afa16e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"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":"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":"Code-Review","score":0,"reason":"Found 0/8 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":"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":"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":"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":"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":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v1.14.0 not signed: https://api.github.com/repos/erkandem/calcbsimpvol/releases/25393296","Warn: release artifact v1.14.0 does not have provenance: https://api.github.com/repos/erkandem/calcbsimpvol/releases/25393296"],"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 'master'"],"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":1,"reason":"9 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-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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 23 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T15:32:16.236Z","repository_id":89303247,"created_at":"2025-08-18T15:32:16.236Z","updated_at":"2025-08-18T15:32:16.236Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: 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":["black-scholes","finance","implied-volatility","options","options-pricing","python"],"created_at":"2026-01-16T14:13:08.347Z","updated_at":"2026-01-16T14:13:08.530Z","avatar_url":"https://github.com/erkandem.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![Build Status](https://travis-ci.com/erkandem/calcbsimpvol.svg?token=EM8YQfR9wuLvQFQzBZ5o\u0026branch=master)](https://travis-ci.com/erkandem/calcbsimpvol)\n![](https://img.shields.io/badge/License-MIT-blue.svg)\n![](https://img.shields.io/badge/Python-3.4%20%7C%203.5%20%7C%203.6%20%7C%203.7%20%7C%203.8%20%7C%20PyPy3-blue.svg)\n[![](https://img.shields.io/badge/PyPi-v1.14.0-blue.svg)](https://pypi.org/project/calcbsimpvol/)\n\n# calcbsimpvol\n\n*Calculate Black-Scholes Implied Volatility - Vectorwise*\n\n----------------------\n\n* `:)` native python code\n* `:)` lightweight footprint\n* `:)` sample data included\n* `:(` not suited for single / low number of options\n* `:(` code reads un-pythonic\n* `:(` not yet thoroughly tested\n\n## Getting started\n\n### Requirements\n\n* Python 3.x (currently) or PyPy3\n* NumPy\n* SciPy\n* (MatPlotLib to visualize results in some examples)\n\n###  Installation\n\nWhile the code consists of single digit functions,\nI recommend using the `pip install` way to get the code.\nThat way you would take advantage of bug fixes, updates,\nand possible extensions.\n\n```bash\n$ pip install calcbsimpvol\n```\n\n### Example\n\nPass your `args` bundled in a `dict`.\n\n```python\nfrom calcbsimpvol import calcbsimpvol\nimport numpy as np\n\nS = np.asarray(100)\nK_value = np.arange(40, 160, 25)\nK = np.ones((np.size(K_value), 1))\nK[:, 0] = K_value\ntau_value = np.arange(0.25, 1.01, 0.25)\ntau = np.ones((np.size(tau_value), 1))\ntau[:, 0] = tau_value\nr = np.asarray(0.01)\nq = np.asarray(0.03)\ncp = np.asarray(1)\nP = [[59.35, 34.41, 10.34, 0.50, 0.01],\n[58.71, 33.85, 10.99, 1.36, 0.14],\n[58.07, 33.35, 11.50, 2.12, 0.40],\n[57.44, 32.91, 11.90, 2.77, 0.70]]\n\nP = np.asarray(P)\n[K, tau] = np.meshgrid(K, tau)\n\nsigma = calcbsimpvol(dict(cp=cp, P=P, S=S, K=K, tau=tau, r=r, q=q))\nprint(sigma)\n\n# [[      nan,       nan,  0.20709362, 0.21820954, 0.24188675],\n# [       nan, 0.22279836, 0.20240934, 0.21386148, 0.23738982],\n# [       nan, 0.22442837, 0.1987048 , 0.21063506, 0.23450013],\n# [       nan, 0.22188111, 0.19564657, 0.20798285, 0.23045406]]\n\n```\n\nMore usage examples are available in [example3.py](https://github.com/erkandem/calcbsimpvol) \n(additional sample data required which is  available at [GitHub Repo](https://github.com/erkandem/calcbsimpvol)\n\n## Performance\n```\nDesign a test. \nGet the results you want.\n```\n\n* `k_max = 10` (default) \n* `tolerance = 10E-12` (default)\n* linear regression steps are commented out (default)\n\n```bash\n# assuming you did install it already\ngit clone https://github.com/erkandem/calcbsimpvol.git\ncd calcbsimpvol\npython examples/example3.py --steps 100 --mode reference\n```\n\n\n* 15 µs per option\n* 41 ms per surface\n\ntested with 3.6, 3.7 and PyPy3\n```bash\nmatlab -nodisplay -nosplash -nodesktop -r \"run('mlb_reference_example.m');\"\n```\n\n* 12 µs per option\n* 34 ms per surface \n\n\nObviously, these values are per core (i5 4210U 1.7 GHz).\n\n\n## Notes\nGood Python code reads like a novel. Right? So should math.\nI preferred short math-like variable names in this case.\nThat makes the code less readable compared to other Python code \nbut the docstrings should make up for the lack of readability.\n\nOriginally, I left the camelCase function name and spelling in place but eventually got annoyed.\n\u003e calcbsimpvol it is\n\n\n## Code Origin\n\n* first thought of by Li (2006) (see References)\n* implemented and published by Mark Whirdy as MATLAB .m-code (see References)\n* numpyified from `.m` to `.py` by me\n\n\n## Contact\n* email: [erkan.dem@pm.me](mailto:erkan.dem@pm.me)\n* documentation: [erkandem.github.io/calcbsimpvol/](https://erkandem.github.io/calcbsimpvol/)\n* source: [github.com/erkandem/calcbsimpvol](https://github.com/erkandem/calcbsimpvol)\n* issues: [github.com/erkandem/calcbsimpvol/issues](https://github.com/erkandem/calcbsimpvol/issues)\n\n## ToDos\n* make the code compatible with `Python 2`\n* make it `PyPy` compatible\n\n\n\n## References\n1)  Li, 2006, \"You Don't Have to Bother Newton for Implied Volatility\"\n\n    [http://papers.ssrn.com/sol3/papers.cfm?abstract_id=952727](http://papers.ssrn.com/sol3/papers.cfm?abstract_id=952727)\n\n2)  MATLAB source code available at:\n\n    [https://www.mathworks.com/matlabcentral/fileexchange/41473-calcbsimpvol-cp-p-s-k-t-r-q](https://www.mathworks.com/matlabcentral/fileexchange/41473-calcbsimpvol-cp-p-s-k-t-r-q)\n\n## License\nThe included Python code is licensed under `MIT` [License](https://github.com/calcbsimpvol/calcbsimpvol/LICENCE)\n\nThe Code by Mark Whirdy is licensed under `MIT` [License](https://github.com/erkandem/calcbsimpvol/calcBSImpVol_mlab/LICENSE)\n\nThe translation is not related or endorsed by the original author.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferkandem%2Fcalcbsimpvol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferkandem%2Fcalcbsimpvol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferkandem%2Fcalcbsimpvol/lists"}