{"id":20539482,"url":"https://github.com/lestherll/expr_calc","last_synced_at":"2026-05-28T01:31:35.787Z","repository":{"id":57427730,"uuid":"400031844","full_name":"lestherll/expr_calc","owner":"lestherll","description":"Expression interpreter written in Python","archived":false,"fork":false,"pushed_at":"2021-09-12T04:54:29.000Z","size":103,"stargazers_count":1,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-22T22:53:01.753Z","etag":null,"topics":["calculator","interpreter","python","python3"],"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/lestherll.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":"2021-08-26T03:46:36.000Z","updated_at":"2021-10-17T03:06:56.000Z","dependencies_parsed_at":"2022-09-09T08:51:02.817Z","dependency_job_id":null,"html_url":"https://github.com/lestherll/expr_calc","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/lestherll/expr_calc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lestherll%2Fexpr_calc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lestherll%2Fexpr_calc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lestherll%2Fexpr_calc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lestherll%2Fexpr_calc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lestherll","download_url":"https://codeload.github.com/lestherll/expr_calc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lestherll%2Fexpr_calc/sbom","scorecard":{"id":585730,"data":{"date":"2025-08-11","repo":{"name":"github.com/lestherll/expr_calc","commit":"dcf087c93ef1504bd30c73bac972f52cc504ac17"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 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":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":"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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Warn: no topLevel permission defined: .github/workflows/publish.yml:1","Warn: no topLevel permission defined: .github/workflows/test_other_branch.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":"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":"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/main.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/lestherll/expr_calc/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/lestherll/expr_calc/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/lestherll/expr_calc/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/lestherll/expr_calc/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test_other_branch.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/lestherll/expr_calc/test_other_branch.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test_other_branch.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/lestherll/expr_calc/test_other_branch.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/main.yml:36","Warn: pipCommand not pinned by hash: .github/workflows/main.yml:37","Warn: pipCommand not pinned by hash: .github/workflows/main.yml:38","Warn: pipCommand not pinned by hash: .github/workflows/test_other_branch.yml:34","Warn: pipCommand not pinned by hash: .github/workflows/test_other_branch.yml:35","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   5 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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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"}}]},"last_synced_at":"2025-08-20T20:27:51.296Z","repository_id":57427730,"created_at":"2025-08-20T20:27:51.296Z","updated_at":"2025-08-20T20:27:51.296Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33590884,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["calculator","interpreter","python","python3"],"created_at":"2024-11-16T00:52:18.951Z","updated_at":"2026-05-28T01:31:35.771Z","avatar_url":"https://github.com/lestherll.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Calc Interpreter\n[![Python Package](https://github.com/lestherll/calc/actions/workflows/main.yml/badge.svg)](https://github.com/lestherll/calc/actions/workflows/main.yml)\n[![other branches](https://github.com/lestherll/expr_calc/actions/workflows/test_other_branch.yml/badge.svg?branch=arbitrary-precision)](https://github.com/lestherll/expr_calc/actions/workflows/test_other_branch.yml)\n[![Python Version](https://img.shields.io/pypi/pyversions/expr-calc?style=plastic)](https://pypi.org/project/expr-calc/)\n[![Python Implementation](https://img.shields.io/pypi/implementation/expr-calc?style=plastic\u0026color=green)](https://python.org/downloads)\n\nAn interpreter modeled after a calculator implemented in Python 3.\nThe program currently only supports basic mathematical expressions.\nThe package uses Reverse Polish Notation also known as postfix expression\ninternally to easily represent mathematical expressions. This is powerful\nas it allows operators to be *organised* in such a way that precedence\nis *absolute* meaning an operator that is encountered first will always\nbe executed first.\n\nHowever, it is obvious that postfix is not *normal* or rather not usually \ntaught in schools and thus infix expression is still the way for the user \nto write expressions. The interpreter uses a modified Shunting-Yard algorithm\nto produce Abstract Syntax Trees. Evaluation of ASTs is trivial, and they are\nflexible making it easy to extend the grammar and functionality later on.\n\n## Installation\nThe package is available in PyPI and can be installed via pip.\n```shell\npip install expr-calc\n#or\npython3 -m pip install expr-calc\n```\n\n## Usage \nThe best way to run the program currently is to execute the REPL and\ncan be done in a python file or through your terminal.\n\nAssuming your present working directory is inside the cloned repo, you\ncan run the following command without the comment.\n```shell\n# inside /clone_path/expr_calc/\npython -m expr_calc\n```\nThe test suite can also be ran with `pytest` when inside the cloned repo\n```shell\npytest  # or python -m pytest\n```\n\n## Example\nOnce inside the REPL, you can start evaluating expressions. Currently, \nonly operators listed in [Features](#features) are supported.\n```shell\ncalc\u003e 1 + 1\n2\n\ncalc\u003e 345--500\n845\n\ncalc\u003e -2\n-2\n\ncalc\u003e 123 ^ 4\n228886641\n\ncalc\u003e 32 / 1.5\n21.33333333333333333333333333\n\ncalc\u003e 123 * 456\n56088\n\ncalc\u003e 34 % 5\n4\n\ncalc\u003e 4 ^ 1/2\n0.5\n\ncalc\u003e 4 ^ (1/2)\n2.0\n```\n\n## Features\n- Infix expressions\n- Basic operators such as `+, -, *, /, %, ^`\n- Tokens created from an expression can also be fetched to be manipulated if one wanted to do so\n- Expressions are transformed into m-ary Tree objects connected to each other\n\n### Features I want to add later\n- variable support\n- custom functions\n- more mathematical functions such as `sin`, `cos`, `tan`, etc\n- and possibly a simple symbolic computation support\n\n## Resources\n- [Reverse Polish Notation](https://en.wikipedia.org/wiki/Reverse_Polish_notation)\n- [Shunting Yard Algorithm](https://en.wikipedia.org/wiki/Shunting-yard_algorithm)\n- [Floating-point arithmetic](https://floating-point-gui.de/formats/fp/)\n- [Calculator test suite](https://mozilla.github.io/calculator/test/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flestherll%2Fexpr_calc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flestherll%2Fexpr_calc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flestherll%2Fexpr_calc/lists"}