{"id":13849707,"url":"https://github.com/fumitoh/modelx","last_synced_at":"2026-01-24T14:03:47.873Z","repository":{"id":51313612,"uuid":"103847434","full_name":"fumitoh/modelx","owner":"fumitoh","description":"Use Python like a spreadsheet!","archived":false,"fork":false,"pushed_at":"2026-01-17T12:59:55.000Z","size":4523,"stargazers_count":116,"open_issues_count":32,"forks_count":28,"subscribers_count":15,"default_branch":"main","last_synced_at":"2026-01-17T23:28:17.719Z","etag":null,"topics":["actuarial","actuary","cache","finance","memoization","modeling","monte-carlo","python","quantitative-finance","recursion","risk-management","time-series"],"latest_commit_sha":null,"homepage":"https://modelx.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fumitoh.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.GPL.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-09-17T17:20:25.000Z","updated_at":"2026-01-17T12:59:59.000Z","dependencies_parsed_at":"2023-02-18T14:15:50.792Z","dependency_job_id":"869f8a6b-2307-496c-9164-80f37897d91f","html_url":"https://github.com/fumitoh/modelx","commit_stats":{"total_commits":1308,"total_committers":4,"mean_commits":327.0,"dds":0.01758409785932724,"last_synced_commit":"8b309daecc4c0997441ade22bd25f4a56f1b5e6e"},"previous_names":[],"tags_count":64,"template":false,"template_full_name":null,"purl":"pkg:github/fumitoh/modelx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fumitoh%2Fmodelx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fumitoh%2Fmodelx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fumitoh%2Fmodelx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fumitoh%2Fmodelx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fumitoh","download_url":"https://codeload.github.com/fumitoh/modelx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fumitoh%2Fmodelx/sbom","scorecard":{"id":112950,"data":{"date":"2025-08-11","repo":{"name":"github.com/fumitoh/modelx","commit":"6725f9382267f0cd0953ce696c397f31ca9c14bf"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"checks":[{"name":"Code-Review","score":1,"reason":"Found 3/30 approved changesets -- score normalized to 1","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":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/python-package.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/python-publish.yml:16","Info: no jobLevel write permissions found"],"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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":7,"reason":"3 commit(s) and 6 issue activity found in the last 90 days -- score normalized to 7","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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.txt:0","Info: FSF or OSI recognized license: GNU Lesser General Public License v3.0: LICENSE.txt: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":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/python-publish.yml:19"],"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":"Pinned-Dependencies","score":1,"reason":"dependency not pinned by hash detected -- score normalized to 1","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-package.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/fumitoh/modelx/python-package.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-package.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/fumitoh/modelx/python-package.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/fumitoh/modelx/python-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/fumitoh/modelx/python-publish.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:43","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:45","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:31","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:32","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   4 pipCommand dependencies pinned"],"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":"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":"20 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2017-48 / GHSA-chqf-hx79-gxc6","Warn: Project is vulnerable to: PYSEC-2020-73","Warn: Project is vulnerable to: GHSA-34jh-p97f-mpxf","Warn: Project is vulnerable to: PYSEC-2023-212 / GHSA-g4mx-q9vg-27p4","Warn: Project is vulnerable to: PYSEC-2023-207 / GHSA-gwvm-45gx-3cf8","Warn: Project is vulnerable to: PYSEC-2019-133 / GHSA-mh33-7rrq-662w","Warn: Project is vulnerable to: GHSA-pq67-6m6q-mj2v","Warn: Project is vulnerable to: PYSEC-2019-132 / GHSA-r64q-w8jr-g9qp","Warn: Project is vulnerable to: PYSEC-2023-192 / GHSA-v845-jxx5-vc9f","Warn: Project is vulnerable to: PYSEC-2020-148 / GHSA-wqvq-5m8c-6g24","Warn: Project is vulnerable to: PYSEC-2018-32 / GHSA-www2-v7xj-xrc6","Warn: Project is vulnerable to: PYSEC-2021-108","Warn: Project is vulnerable to: PYSEC-2021-856 / GHSA-5545-2q6w-2gh6","Warn: Project is vulnerable to: GHSA-6p56-wp2h-9hxr","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-2019-41 / GHSA-qfc5-mcwq-26q8","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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 6 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-15T15:38:00.133Z","repository_id":51313612,"created_at":"2025-08-15T15:38:00.134Z","updated_at":"2025-08-15T15:38:00.134Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28729411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T10:24:43.181Z","status":"ssl_error","status_checked_at":"2026-01-24T10:24:36.112Z","response_time":89,"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":["actuarial","actuary","cache","finance","memoization","modeling","monte-carlo","python","quantitative-finance","recursion","risk-management","time-series"],"created_at":"2024-08-04T20:00:38.556Z","updated_at":"2026-01-24T14:03:47.856Z","avatar_url":"https://github.com/fumitoh.png","language":"Python","funding_links":[],"categories":["Full-Fledged Modeling Packages","Python"],"sub_categories":["Experience Analysis"],"readme":"modelx\n======\n*Use Python like a spreadsheet!*\n\n.. image:: https://github.com/fumitoh/modelx/actions/workflows/python-package.yml/badge.svg\n    :target: https://github.com/fumitoh/modelx/actions/workflows/python-package.yml\n\n.. image:: https://img.shields.io/pypi/pyversions/modelx\n    :target: https://pypi.org/project/modelx/\n\n.. image:: https://img.shields.io/pypi/v/modelx\n    :target: https://pypi.org/project/modelx/\n\n.. image:: https://img.shields.io/pypi/l/modelx\n    :target: https://github.com/fumitoh/modelx/blob/master/LICENSE.LESSER.txt\n\n\n.. Overview Begin\n\nWhat is modelx?\n---------------\n**modelx** is a numerical computing tool that enables you to\nuse Python like a spreadsheet by quickly defining cached functions.\nmodelx is best suited for implementing mathematical models expressed\nin a large system of recursive formulas,\nin such fields as actuarial science, quantitative finance and risk management.\n\nSee also the `GitHub Copilot instructions for modelx \u003chttps://github.com/fumitoh/modelx/blob/main/.github/copilot-instructions.md\u003e`_.\n\nFeature highlights\n------------------\n**modelx** enables you to interactively\ndevelop, run and debug complex models in smart ways.\nmodelx allows you to:\n\n- Define cached functions as *Cells* objects by writing Python functions\n- Quickly build object-oriented models, utilizing prototype-based inheritance and composition\n- Quickly parameterize a set of formulas and get results for different parameters\n- Trace formula dependency\n- Import and use any Python modules, such as `Numpy`_, `pandas`_, `SciPy`_, `scikit-learn`_, etc..\n- See formula traceback upon error and inspect local variables\n- Save models to text files and version-control with `Git`_\n- Save data such as pandas DataFrames in Excel or CSV files within models\n- Auto-document saved models by Python documentation generators, such as `Sphinx`_\n- Use Spyder with a plugin for modelx (`spyder-modelx`_) to interface with modelx through GUI\n- Export models as Python modules independent of modelx\n- Translate exported models to Cython optimized code and compile them for performance improvement using Cython through `modelx-cython`_ \n\n.. _Numpy: https://numpy.org/\n.. _pandas: https://pandas.pydata.org/\n.. _SciPy: https://scipy.org/\n.. _scikit-learn: https://scikit-learn.org/\n.. _Git: https://git-scm.com/\n.. _Sphinx: https://www.sphinx-doc.org\n.. _spyder-modelx: https://github.com/fumitoh/spyder-modelx\n.. _modelx-cython: https://github.com/fumitoh/modelx-cython\n\n\nmodelx sites\n-------------\n\n========================== ===============================================\nHome page                  https://modelx.io\nBlog                       https://modelx.io/allposts\nDocumentation site         https://docs.modelx.io\nDevelopment                https://github.com/fumitoh/modelx\nDiscussion Forum           https://github.com/fumitoh/modelx/discussions\nmodelx on PyPI             https://pypi.org/project/modelx/\n========================== ===============================================\n\n\nWho is modelx for?\n------------------\n**modelx** is designed to be domain agnostic, \nso it's useful for anyone in any field.\nEspecially, modelx is suited for modeling in such fields such as:\n\n- Quantitative finance\n- Risk management\n- Actuarial science\n\n**lifelib** (https://lifelib.io) is a library of actuarial and\nfinancial models that are built on top of modelx.\n\nHow modelx works\n----------------\n\nBelow is an example showing how to build a simple model using modelx.\nThe model performs a Monte Carlo simulation to generate 10,000\nstochastic paths of a stock price that follow a geometric Brownian motion\nand to price an European call option on the stock.\n\n.. code-block:: python\n\n    import modelx as mx\n    import numpy as np\n\n    model = mx.new_model()                  # Create a new Model named \"Model1\"\n    space = model.new_space(\"MonteCarlo\")   # Create a UserSpace named \"MonteCralo\"\n\n    # Define names in MonteCarlo\n    space.np = np\n    space.M = 10000     # Number of scenarios\n    space.T = 3         # Time to maturity in years\n    space.N = 36        # Number of time steps\n    space.S0 = 100      # S(0): Stock price at t=0\n    space.r = 0.05      # Risk Free Rate\n    space.sigma = 0.2   # Volatility\n    space.K = 110       # Option Strike\n\n\n    # Define Cells objects in MonteCarlo from function definitions\n    @mx.defcells\n    def std_norm_rand():\n        gen = np.random.default_rng(1234)\n        return gen.standard_normal(size=(N, M))\n\n\n    @mx.defcells\n    def stock(i):\n        \"\"\"Stock price at time t_i\"\"\"\n        dt = T/N; t = dt * i\n        if i == 0:\n            return np.full(shape=M, fill_value=S0)\n        else:\n            epsilon = std_norm_rand()[i-1]\n            return stock(i-1) * np.exp((r - 0.5 * sigma**2) * dt + sigma * epsilon * dt**0.5)\n\n\n    @mx.defcells\n    def call_opt():\n        \"\"\"Call option price by Monte Carlo\"\"\"\n        return np.average(np.maximum(stock(N) - K, 0)) * np.exp(-r*T)\n\nRunning the model from IPython is as simple as calling a function:\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e stock(space.N)      # Stock price at i=N i.e. t=T\n    array([ 78.58406132,  59.01504804, 115.148291  , ..., 155.39335662,\n            74.7907511 , 137.82730703])\n\n    \u003e\u003e\u003e call_opt()\n    16.26919556999345\n\nChanging a parameter is as simple as assigning a value to a name:\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e space.K = 100   # Cache is cleared by this assignment\n\n    \u003e\u003e\u003e call_opt()    # New option price for the updated strike\n    20.96156962064\n\nYou can even dynamically create multiple copies of *MonteCarlo*\nwith different combinations of ``r`` and ``sigma``,\nby parameterizing *MonteCarlo* with ``r`` and ``sigma``:\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e space.parameters = (\"r\", \"sigma\")   # Parameterize MonteCarlo with r and sigma\n\n    \u003e\u003e\u003e space[0.03, 0.15].call_opt()  # Dynamically create a copy of MonteCarlo with r=3% and sigma=15%\n    14.812014828333284\n\n    \u003e\u003e\u003e space[0.06, 0.4].call_opt()   # Dynamically create another copy with r=6% and sigma=40%\n    33.90481014639403\n\n\nLicense\n-------\nCopyright 2017-2024, Fumito Hamamura\n\nmodelx is free software; you can redistribute it and/or\nmodify it under the terms of\n`GNU Lesser General Public License v3 (LGPLv3)\n\u003chttps://github.com/fumitoh/modelx/blob/master/LICENSE.LESSER.txt\u003e`_.\n\nContributions, productive comments, requests and feedback from the community\nare always welcome. Information on modelx development is found at Github\nhttps://github.com/fumitoh/modelx\n\n\n.. Overview End\n\n\nRequirements\n------------\n* Python 3.7+\n* NetwrkX 2.0+\n* asttokens\n* LibCST\n* Pandas\n* OpenPyXL\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffumitoh%2Fmodelx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffumitoh%2Fmodelx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffumitoh%2Fmodelx/lists"}