{"id":13411176,"url":"https://github.com/lpozo/mathrepl","last_synced_at":"2026-04-27T02:31:57.608Z","repository":{"id":141584379,"uuid":"252475136","full_name":"lpozo/mathrepl","owner":"lpozo","description":"MathREPL, a math expression evaluator using Python's eval() and math.","archived":false,"fork":false,"pushed_at":"2020-10-12T16:19:39.000Z","size":242,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-07-31T20:45:06.670Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/lpozo.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":"2020-04-02T14:15:07.000Z","updated_at":"2021-11-08T09:28:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"a3e5d6e5-055b-4d25-bc07-8c77673366c2","html_url":"https://github.com/lpozo/mathrepl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpozo%2Fmathrepl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpozo%2Fmathrepl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpozo%2Fmathrepl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpozo%2Fmathrepl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lpozo","download_url":"https://codeload.github.com/lpozo/mathrepl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243179897,"owners_count":20249187,"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":[],"created_at":"2024-07-30T20:01:11.953Z","updated_at":"2025-12-26T02:36:51.501Z","avatar_url":"https://github.com/lpozo.png","language":"Python","funding_links":[],"categories":["Tutorials \u0026 Challenges"],"sub_categories":["Desktop"],"readme":"# MathREPL\n\nMathREPL, a math expression evaluator using Python `eval()` and the `math` module.\n\nMathREPL is an attempt to show how to use Python `eval()` to solve real-world problems while minimizing (but not removing) its security issues. So, the most important piece of code in this application is the function `evaluate()` which lives in the `evaluator` module.\n\nMathREPL is a sample project based on the example I used in my [Real Python](https://realpython.com/) tutorial: [Python eval(): Evaluate Expressions Dynamically](https://realpython.com/python-eval-function/).\n\n![Real Python Tutorial](real-python-image.jpeg)\n\n## Installation\n\n1. Clone the repo (`git clone https://github.com/lpozo/mathrepl.git`)\n2. `cd` into the directory of the repo (`cd mathrepl`)\n3. Run the main script (`python3 main.py`)\n\n## Usage example\n\nThe steps in the previous section will preset you with a prompt like this:\n\n```sh\nMathREPL 1.0, your Python math expressions evaluator!\nEnter a valid math expression after the prompt \"mr\u003e\u003e\".\nType \"help\" for more information.\nType \"quit\" or \"exit\" to exit.\n\nmr\u003e\u003e\n```\n\nAt `mr\u003e\u003e` type any math expression that follows Python syntax and uses the functionalities defined in the Python `math` module. For example:\n\n```sh\nmr\u003e\u003e (5 + 7) / 2\n6.0\nmr\u003e\u003e sqrt(pow(10, 2) + pow(15, 2))\n18.027756377319946\nmr\u003e\u003e\n```\n\n## Release History\n\n- **Version 1.0**\n  - Include basic functionalities to evaluate math-related expressions with Python `eval()` function and the `math` module.\n\n## Contributing\n\n1. Fork MathREPL from (\u003chttps://github.com/lpozo/mathrepl/fork\u003e)\n2. Clone your fork locally (`git clone https://github.com/your_user_name/mathrepl.git`)\n3. Create your feature branch (`git checkout -b feature_awesome_feature`)\n4. Commit your changes (`git commit -am 'Add some awesome feature'`)\n5. Push to the branch (`git push -u origin feature_awesome_feature`)\n6. Create a new Pull Request against the `develop` branch of MathREPL\n7. Wait for code review and feedback\n\n## Running the tests\n\nYou can run the tests for MathREPL using `pytest`. To do this, just open a command-line in MathREPL's root directory and run the following command:\n\n```sh\n$ pytest -v tests\n```\n\nYou might need to include the current directory (`.`) in your Python path (`PYTHONPATH`) for this to work. A fast way to do that is by typing the following command in your command-line:\n\n```sh\n$ export PYTHONPATH=\"$PYTHONPATH:.\"\n```\n\n## Author\n\nLeodanis Pozo Ramos – Twitter: [@lpozo78](https://twitter.com/lpozo78) – E-mail: lpozor78@gmail.com\n\n## License\n\nMathREPL is distributed under the MIT license. See [LICENSE](https://github.com/lpozo/mathrepl) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpozo%2Fmathrepl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flpozo%2Fmathrepl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpozo%2Fmathrepl/lists"}