rsc


Namersc JSON
Version 0.3.2 PyPI version JSON
download
home_pageNone
SummaryThe simplest calculator library in Python with variable support
upload_time2025-08-08 17:46:34
maintainerNone
docs_urlNone
authorNone
requires_python>=3.6
licenseMIT License Copyright (c) 2025 Rasa Dariush Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords calculator math expression variables safe-eval
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 📐 RSC (Really Simple Calculator)

RSC is the simplest calculator library in Python!  
It lets you evaluate complex math expressions **safely**, with support for variables and all basic math operators.

Version: **0.3.2** – *Improved API with setv() and calc()*

---

## 🔧 Installation

```bash
pip install rsc
````

or

```bash
pip install rsc==0.3.2
```

---

## 🚀 Quick Start

```python
import rsc

print(rsc.calc("2 + 3 * (4 - 1)"))  # ➜ 11
print(rsc.calc("5 ^ 2 + 10"))       # ➜ 35
```

You can also assign variables:

```python
rsc.setv("a", 10)
rsc.setv("b", 20)
rsc.setv("c", 10)

print(rsc.calc("a + b - c"))     # ➜ 20
print(rsc.calc("(a + b) - c"))   # ➜ 20
```

---

## ✅ Supported Features

* Operators: `+`, `-`, `*`, `x`, `/`, `//`, `%`, `**`, `^`
* Parentheses for grouping
* Variables using `setv(name, value)`
* Safe evaluation (using `asteval`)
* Simple API

---

## 📘 Usage Reference

```python
rsc.calc(expression: str) -> float | str
```

```python
rsc.setv(name: str, value: float | int)
```

```python
rsc.show_help()  # Prints usage instructions
```

---

## 🌐 Links

* [GitHub Repo](https://github.com/Rasa8877/rs-calculator-rsc)
* Contact: [letperhut@gmail.com](mailto:letperhut@gmail.com)

---

## 🧠 Author

Made with ❤️ by Rasa8877
RSC — the simplest calculator library in Python!

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "rsc",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "calculator, math, expression, variables, safe-eval",
    "author": null,
    "author_email": "Rasa8877 <letperhut@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/34/93/6c60d92f63c3a88f6d0c5ae123842ef04ba60db7b4b92c591cc814f69551/rsc-0.3.2.tar.gz",
    "platform": null,
    "description": "# \ud83d\udcd0 RSC (Really Simple Calculator)\n\nRSC is the simplest calculator library in Python!  \nIt lets you evaluate complex math expressions **safely**, with support for variables and all basic math operators.\n\nVersion: **0.3.2** \u2013 *Improved API with setv() and calc()*\n\n---\n\n## \ud83d\udd27 Installation\n\n```bash\npip install rsc\n````\n\nor\n\n```bash\npip install rsc==0.3.2\n```\n\n---\n\n## \ud83d\ude80 Quick Start\n\n```python\nimport rsc\n\nprint(rsc.calc(\"2 + 3 * (4 - 1)\"))  # \u279c 11\nprint(rsc.calc(\"5 ^ 2 + 10\"))       # \u279c 35\n```\n\nYou can also assign variables:\n\n```python\nrsc.setv(\"a\", 10)\nrsc.setv(\"b\", 20)\nrsc.setv(\"c\", 10)\n\nprint(rsc.calc(\"a + b - c\"))     # \u279c 20\nprint(rsc.calc(\"(a + b) - c\"))   # \u279c 20\n```\n\n---\n\n## \u2705 Supported Features\n\n* Operators: `+`, `-`, `*`, `x`, `/`, `//`, `%`, `**`, `^`\n* Parentheses for grouping\n* Variables using `setv(name, value)`\n* Safe evaluation (using `asteval`)\n* Simple API\n\n---\n\n## \ud83d\udcd8 Usage Reference\n\n```python\nrsc.calc(expression: str) -> float | str\n```\n\n```python\nrsc.setv(name: str, value: float | int)\n```\n\n```python\nrsc.show_help()  # Prints usage instructions\n```\n\n---\n\n## \ud83c\udf10 Links\n\n* [GitHub Repo](https://github.com/Rasa8877/rs-calculator-rsc)\n* Contact: [letperhut@gmail.com](mailto:letperhut@gmail.com)\n\n---\n\n## \ud83e\udde0 Author\n\nMade with \u2764\ufe0f by Rasa8877\nRSC \u2014 the simplest calculator library in Python!\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2025 Rasa Dariush\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.",
    "summary": "The simplest calculator library in Python with variable support",
    "version": "0.3.2",
    "project_urls": {
        "Homepage": "https://github.com/Rasa8877/rs-calculator-rsc"
    },
    "split_keywords": [
        "calculator",
        " math",
        " expression",
        " variables",
        " safe-eval"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "afb013583be0f1ad0991488e3d0f653b8e31c13c9abba5a8c571d01f83f7b74c",
                "md5": "f9a0f68bb8560f52549aa8f649a8f75c",
                "sha256": "ed814234a8ff9246e5d487c4ba2d53132e79c44f28e6106544f432a0082e4261"
            },
            "downloads": -1,
            "filename": "rsc-0.3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f9a0f68bb8560f52549aa8f649a8f75c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 4193,
            "upload_time": "2025-08-08T17:46:33",
            "upload_time_iso_8601": "2025-08-08T17:46:33.606764Z",
            "url": "https://files.pythonhosted.org/packages/af/b0/13583be0f1ad0991488e3d0f653b8e31c13c9abba5a8c571d01f83f7b74c/rsc-0.3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "34936c60d92f63c3a88f6d0c5ae123842ef04ba60db7b4b92c591cc814f69551",
                "md5": "801b1298d4826cfaab4a1bd5d624ce25",
                "sha256": "7d940dd4b5c07b054fb43882ef8dec2a237e5e872b749322e9a61c9c41f6a624"
            },
            "downloads": -1,
            "filename": "rsc-0.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "801b1298d4826cfaab4a1bd5d624ce25",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 3445,
            "upload_time": "2025-08-08T17:46:34",
            "upload_time_iso_8601": "2025-08-08T17:46:34.891478Z",
            "url": "https://files.pythonhosted.org/packages/34/93/6c60d92f63c3a88f6d0c5ae123842ef04ba60db7b4b92c591cc814f69551/rsc-0.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-08 17:46:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Rasa8877",
    "github_project": "rs-calculator-rsc",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "rsc"
}
        
Elapsed time: 4.45382s