Metadata-Version: 2.4
Name: calcmate
Version: 0.1.1
Summary: Beginner-friendly arithmetic — all five operations in one function call.
Author-email: Deepali Madala <deepali@codegnan.com>
License: MIT
Project-URL: Homepage, https://github.com/codegnan-dm/calcmate
Project-URL: Repository, https://github.com/codegnan-dm/calcmate
Project-URL: Issues, https://github.com/codegnan-dm/calcmate/issues
Keywords: arithmetic,calculator,beginner,education,math
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Education
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: build>=1.0; extra == "dev"
Requires-Dist: twine>=5.0; extra == "dev"

# calcmate

**Beginner-friendly arithmetic — all five operations in one function call.**

[![PyPI version](https://img.shields.io/pypi/v/calcmate.svg)](https://pypi.org/project/calcmate/)
[![Python](https://img.shields.io/pypi/pyversions/calcmate.svg)](https://pypi.org/project/calcmate/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

---

## Why calcmate?

Learning Python means dealing with a lot of syntax before you get to the interesting parts. `calcmate` removes the friction from basic arithmetic so beginners can focus on *concepts* rather than operators.

**Without calcmate:**

```python
a = 21
b = 7
print(a + b)
print(a - b)
print(a * b)
print(a / b)
print(a // b)
```

**With calcmate:**

```python
from calcmate import calc

print(calc(21, 7))
```

```
{'add': 28, 'sub': 14, 'mul': 147, 'div': 3.0, 'floordiv': 3}
```

---

## Installation

```bash
pip install calcmate
```

Requires Python 3.8 or higher. No dependencies.

---

## Usage

### All operations at once

```python
from calcmate import calc

result = calc(15, 3)
print(result)
# {'add': 18, 'sub': 12, 'mul': 45, 'div': 5.0, 'floordiv': 5}
```

### One operation at a time

```python
calc(21, 7, '+')   # 28
calc(21, 7, '-')   # 14
calc(21, 7, '*')   # 147
calc(21, 7, '/')   # 3.0
calc(21, 7, '//')  # 3
```

### Safe division

```python
calc(10, 0)
# {'add': 10, 'sub': 10, 'mul': 0,
#  'div': 'Cannot divide by zero',
#  'floordiv': 'Cannot divide by zero'}
```

---

## API reference

### `calc(a, b, op=None)`

| Parameter | Type | Description |
|-----------|------|-------------|
| `a` | `int` or `float` | First operand |
| `b` | `int` or `float` | Second operand |
| `op` | `str`, optional | Operator: `'+'`, `'-'`, `'*'`, `'/'`, `'//'` |

**Returns:**
- A single `int`, `float`, or `str` when `op` is provided
- A `dict` with keys `add`, `sub`, `mul`, `div`, `floordiv` when `op` is omitted

**Raises:**
- `TypeError` — if `a` or `b` are not numeric, or `op` is not a string
- `ValueError` — if `op` is not one of the five supported operators

---

## Contributing

```bash
git clone https://github.com/yourusername/calcmate.git
cd calcmate
pip install -e ".[dev]"
pytest
```

---

## License

MIT — see [LICENSE](LICENSE) for details.
