{"id":21058678,"url":"https://github.com/facaiy/math-expression-parser","last_synced_at":"2025-07-02T04:32:25.010Z","repository":{"id":57733185,"uuid":"94990245","full_name":"facaiy/math-expression-parser","owner":"facaiy","description":"A scala library for parsing mathemitical expressions with support for parentheses and variables. ","archived":false,"fork":false,"pushed_at":"2020-04-23T07:03:38.000Z","size":54,"stargazers_count":12,"open_issues_count":2,"forks_count":12,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-16T00:42:01.169Z","etag":null,"topics":["math-expression-parser","parsing-mathemitical-expressions","scala-library"],"latest_commit_sha":null,"homepage":null,"language":"Scala","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/facaiy.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":"2017-06-21T10:01:42.000Z","updated_at":"2024-07-15T20:26:22.000Z","dependencies_parsed_at":"2022-09-26T22:11:18.017Z","dependency_job_id":null,"html_url":"https://github.com/facaiy/math-expression-parser","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/facaiy/math-expression-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facaiy%2Fmath-expression-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facaiy%2Fmath-expression-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facaiy%2Fmath-expression-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facaiy%2Fmath-expression-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/facaiy","download_url":"https://codeload.github.com/facaiy/math-expression-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facaiy%2Fmath-expression-parser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263074820,"owners_count":23409825,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["math-expression-parser","parsing-mathemitical-expressions","scala-library"],"created_at":"2024-11-19T17:08:49.465Z","updated_at":"2025-07-02T04:32:24.991Z","avatar_url":"https://github.com/facaiy.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# math-expression-parser\n[\u003cimg src=\"https://img.shields.io/travis/facaiy/math-expression-parser.svg\"/\u003e](https://travis-ci.org/facaiy/math-expression-parser)\n[\u003cimg src=\"https://img.shields.io/maven-central/v/io.github.facaiy/math-expression-parser.svg\"\u003e](http://search.maven.org/#search|ga|1|g:\"io.github.facaiy\"%20AND%20a:\"math-expression-parser\")\n\nA scala library for parsing mathemitical expressions with support for parentheses and variables.\n\nfeatures:\n+ math operators: `+`, `-`, `*`, `/`, `**`(power)\n+ parentheses `( )` and comma `,`\n+ all function of [`scala.math`](http://www.scala-lang.org/api/2.12.1/scala/math/index.html), except of `random`, `E` and `PI`\n+ variable name: `$` with valid Java variable name\n\n\n### Install\n\n1. maven\n   ```\n   \u003cdependency\u003e\n     \u003cgroupId\u003eio.github.facaiy\u003c/groupId\u003e\n     \u003cartifactId\u003emath-expression-parser\u003c/artifactId\u003e\n     \u003cversion\u003e0.0.2\u003c/version\u003e\n   \u003c/dependency\u003e\n   ```\n\n\n### Usage\n\nA simple example:\n\n```scala\nimport io.github.facaiy.math.expression.MathExp\n\nval str = \"1.0 + sqrt(2 * $a1) + $a2 ** 2\"\nval ex = MathExp.parse(str)\n\nval variables = Map(\"a1\" -\u003e 2, \"a2\" -\u003e 1)\nval output = ex.eval(variables)\n// output = 4.0\n\nval output1 = ex.eval(Map(\"a1\" -\u003e 8.0, \"a2\" -\u003e 2))\n// output1 = 9.0\n```\n\n### Release\n\n```bash\n# Ref: https://central.sonatype.org/pages/apache-maven.html\nmvn release:clean release:prepare\nmvn release:perform\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacaiy%2Fmath-expression-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffacaiy%2Fmath-expression-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacaiy%2Fmath-expression-parser/lists"}