{"id":37066528,"url":"https://github.com/bertiqwerty/mexpress","last_synced_at":"2026-01-14T07:48:42.059Z","repository":{"id":65720951,"uuid":"415335254","full_name":"bertiqwerty/mexpress","owner":"bertiqwerty","description":"Math parser and evaluator based on the Rust crate Exmex","archived":false,"fork":false,"pushed_at":"2025-10-14T08:48:34.000Z","size":78,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-23T08:03:28.676Z","etag":null,"topics":["gradient","math","parser"],"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/bertiqwerty.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-09T14:41:13.000Z","updated_at":"2025-10-14T08:48:17.000Z","dependencies_parsed_at":"2024-03-01T09:27:56.086Z","dependency_job_id":"e9bb91c1-95a7-4fb3-8278-2f80b35ee017","html_url":"https://github.com/bertiqwerty/mexpress","commit_stats":{"total_commits":60,"total_committers":1,"mean_commits":60.0,"dds":0.0,"last_synced_commit":"420e0214970ecaf2ebefa283c6d9143733e6a234"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/bertiqwerty/mexpress","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertiqwerty%2Fmexpress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertiqwerty%2Fmexpress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertiqwerty%2Fmexpress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertiqwerty%2Fmexpress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bertiqwerty","download_url":"https://codeload.github.com/bertiqwerty/mexpress/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertiqwerty%2Fmexpress/sbom","scorecard":{"id":234608,"data":{"date":"2025-08-11","repo":{"name":"github.com/bertiqwerty/mexpress","commit":"f925908e05f5777c71220624dade7a540b1ff74f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"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":"Code-Review","score":0,"reason":"Found 0/28 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":"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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/bertiqwerty/mexpress/publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/bertiqwerty/mexpress/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/bertiqwerty/mexpress/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/bertiqwerty/mexpress/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/bertiqwerty/mexpress/publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/bertiqwerty/mexpress/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/bertiqwerty/mexpress/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/bertiqwerty/mexpress/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:58: update your workflow using https://app.stepsecurity.io/secureworkflow/bertiqwerty/mexpress/publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:63: update your workflow using https://app.stepsecurity.io/secureworkflow/bertiqwerty/mexpress/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:69: update your workflow using https://app.stepsecurity.io/secureworkflow/bertiqwerty/mexpress/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:81: update your workflow using https://app.stepsecurity.io/secureworkflow/bertiqwerty/mexpress/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:82: update your workflow using https://app.stepsecurity.io/secureworkflow/bertiqwerty/mexpress/publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:86: update your workflow using https://app.stepsecurity.io/secureworkflow/bertiqwerty/mexpress/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:92: update your workflow using https://app.stepsecurity.io/secureworkflow/bertiqwerty/mexpress/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:102: update your workflow using https://app.stepsecurity.io/secureworkflow/bertiqwerty/mexpress/publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:107: update your workflow using https://app.stepsecurity.io/secureworkflow/bertiqwerty/mexpress/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:8: update your workflow using https://app.stepsecurity.io/secureworkflow/bertiqwerty/mexpress/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/bertiqwerty/mexpress/test.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:17","Info:   0 out of  14 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   5 third-party GitHubAction dependencies pinned","Info:   0 out of   1 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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: topLevel 'contents' permission set to 'read': .github/workflows/publish.yml:8","Warn: no topLevel permission defined: .github/workflows/test.yml:1","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":"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":-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":7,"reason":"3 existing vulnerabilities detected","details":["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 2 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-17T05:24:11.758Z","repository_id":65720951,"created_at":"2025-08-17T05:24:11.758Z","updated_at":"2025-08-17T05:24:11.758Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28413498,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["gradient","math","parser"],"created_at":"2026-01-14T07:48:41.564Z","updated_at":"2026-01-14T07:48:42.050Z","avatar_url":"https://github.com/bertiqwerty.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mexpress\nMath parser and evaluator in Python capable of computing gradients and Hessians. Mexpress uses the Rust crate [Exmex](https://crates.io/crates/exmex).\n## Installation \n[![PyPI version](https://img.shields.io/pypi/v/mexpress.svg?maxAge=3600)](https://pypi.org/project/mexpress/)\n[![example workflow](https://github.com/bertiqwerty/mexpress/actions/workflows/test.yml/badge.svg)](https://github.com/bertiqwerty/mexpress)\n[![dependency status](https://deps.rs/repo/github/bertiqwerty/mexpress/status.svg)](https://deps.rs/repo/github/bertiqwerty/mexpress)\n\n```\npip install mexpress\n```\n## Usage\n\n```python\nimport mexpress\nimport numpy as np\n\n# parse function with parse_f64 or parse_f32\nf = mexpress.parse_f64(\"(x - 1) ** 2 - y * x + 3 * y ** 2\")\n\n# evaluate function at (2, 4)\ny = f(2.0, 4.0)\nassert abs(y - 41) \u003c 1e-12\n\n# evaluate gradient at (2, 4)\ngrad_2_4 = f.grad(2.0, 4.0)\nassert np.linalg.norm(grad_2_4 - [-2, 22]) \u003c 1e-12\n\n# evaluate Hessian at (2, 4)\nhess_2_4 = f.hess(2.0, 4.0)\nassert np.linalg.norm(hess_2_4 - [[2, -1], [-1, 6]]) \u003c 1e-12\n```\n\nBesides `**` you can also use `^` for exponentiation. Currently, a list of supported mathematical operators can be found in the documentation of [Exmex](https://docs.rs/exmex/0.12.0/exmex/struct.FloatOpsFactory.html).\n\n## Optimization Example\n\nWith gradients and Hessians one can at least locally optimize differentiable functions passed as strings, e.g., with `scipy.optimize`.\n```Python\nfrom scipy.optimize import minimize\nimport mexpress\n\nfunc_str = f\"(1 - x) ** 2 + 100 * (y - x ** 2) ** 2 + (z - 7) ** 2 + (ρ + 5) ** 2\"\nf = mexpress.parse_f64(func_str)\nres = minimize(f, x0=[0.0, 0.0, 0.0, 0.0], method=\"trust-ncg\", jac=f.grad, hess=f.hess)\n```\nWe have played around with different methods to optimize `func_str`, see the following output of `py/demo/opt.py`. In the following table, `#fails` is the number of fails out of 100 attempts with random `x0`s. The iterations and elapsed seconds are medians.\n```\nCG             #fails   0   #it  44   0.0049996 sec   jac True    hess False\nCG             #fails  23   #it  44   0.0179558 sec   jac False   hess False\nNewton-CG      #fails   0   #it  38   0.0049839 sec   jac True    hess True\nNewton-CG      #fails   5   #it  37   0.0059988 sec   jac True    hess False\ntrust-krylov   #fails   0   #it  31   0.0255845 sec   jac True    hess True\ntrust-ncg      #fails   0   #it  32   0.0030000 sec   jac True    hess True\ntrust-exact    #fails   0   #it  30   0.0060000 sec   jac True    hess True\nBFGS           #fails   0   #it  72   0.0059998 sec   jac True    hess False\nBFGS           #fails  21   #it  74   0.0169995 sec   jac False   hess False\nL-BFGS-B       #fails   0   #it  43   0.0019979 sec   jac True    hess False\nL-BFGS-B       #fails   0   #it  42   0.0069985 sec   jac False   hess False\nNelder-Mead    #fails   0   #it 441   0.0131288 sec   jac False   hess False\nSLSQP          #fails   0   #it  34   0.0029492 sec   jac True    hess False\ndogleg         #fails  17   #it  27   0.0027690 sec   jac True    hess True\nTNC            #fails   0   #it  29   0.0029995 sec   jac True    hess False\nTNC            #fails   0   #it  27   0.0110002 sec   jac False   hess False\nCOBYLA         #fails  46   #it  -1   0.0163412 sec   jac False   hess False\nPOWELL         #fails   0   #it  22   0.0139999 sec   jac False   hess False\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertiqwerty%2Fmexpress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbertiqwerty%2Fmexpress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertiqwerty%2Fmexpress/lists"}