Metadata-Version: 2.4
Name: rsc
Version: 0.2.4
Summary: The simplest calculator library in Python with variable support
Author-email: Rasa8877 <letperhut@gmail.com>
License: MIT 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.
Project-URL: Homepage, https://github.com/Rasa8877/rs-calculator
Keywords: calculator,math,expression,variables,safe-eval
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: asteval
Dynamic: license-file

# 📐 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.2.4** – *Fixed the bugs*

---

## 🔧 Installation

```bash
pip install rsc
```

or

```bash
pip install rsc==0.2.4
```

---

## 🚀 Quick Start

```python
import rsc

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

You can also assign variables:

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

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

---

## ✅ Supported Features

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

---

## 📘 Usage Reference

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

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

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

---

## 🌐 Links

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

---

## 🧠 Author

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