semvec/pypi-packages huggingface dataset:
rs-calculator 0.2.2
A simple calculator library for Python beginners
License: MIT
Requires Python: >=3.6

# 📐 RS Calculator

RS Calculator is the simplest calculator library in Python!  
It lets you evaluate complex math expressions **safely**, with support for variables and all basic math operators.

---

## 🔧 Installation

```bash
pip install rs_calculator
````

---

## 🚀 Quick Start

```python
import rs_calculator as 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
RS Calculator — simplest calculator library in Python!