Metadata-Version: 2.4
Name: rsc
Version: 0.3.0
Summary: The simplest calculator library in Python with variable support, math functions, and assignments
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,factorial,math-functions
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>=0.9.24
Dynamic: license-file

# 📐 RSC (Really Simple Calculator)

RSC is the simplest calculator library in Python!  
It lets you safely evaluate complex math expressions with support for variables, assignments, factorials, and many math functions.

Version: **0.3.0** – *Now with math functions, factorials, assignments & better error handling!*

---

## 🔧 Installation

```bash
pip install rsc
````

or for a specific version:

```bash
pip install rsc==0.3.0
```

---

## 🚀 Quick Start

```python
import rsc

print(rsc.calculate("2 + 3 * (4 - 1)"))    # ➜ 11
print(rsc.calculate("5 ^ 2 + 10"))          # ➜ 35
print(rsc.calculate("sin(pi / 2)"))         # ➜ 1.0
print(rsc.calculate("5! + 10"))              # ➜ 130
```

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("d = (a + b) * c"))      # ➜ 300
print(rsc.calculate("d / 2"))                 # ➜ 150.0
```

---

## ✅ Supported Features

* Operators: `+`, `-`, `*`, `x` (multiplication), `/`, `//`, `%`, `**`, `^`
* Factorial operator: `!` (e.g. `5!`)
* Parentheses for grouping
* Variables and assignments (e.g. `a = 5 + 3`)
* Built-in math functions: `sin`, `cos`, `tan`, `log`, `log10`, `sqrt`, `factorial`, etc.
* Built-in constants: `pi`, `e`, `tau`
* Safe evaluation using `asteval`
* Friendly error messages

---

## 📘 Usage Reference

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

Evaluates the expression string and returns the result or error message.

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

Assigns a variable for use in expressions.

```python
rsc.show_help()
```

Prints detailed 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!
