semvec/pypi-packages huggingface dataset:
open5e-client 0.1.1
A lightweight Python client for the Open5e API
License: MIT
Requires Python: >=3.8

# Open5e Client

# Open5e Python Client

This is a small Python wrapper for the [Open5e API](https://api.open5e.com/).  
This package has dataclasses  that allow the uses to look up spells, monsters, classes, races, and magic items from the 5e System Reference Document and other Open5e-supported content. In future iterations I may add feats and subclasses. 

---

 Overview

The Open5e API provides 5e rules content in a structured JSON format.  
This client wraps that API and provides:

- Python **dataclasses** for each resource
- Methods like  
  `list_spells()`, `list_monsters()`, `get_spell("fireball")`, etc.
- Pagination helpers:  
  `list_all_spells()`, `list_all_monsters()`, etc.
- Pandas dataframe utilities such as  
  `spells_dataframe()`, `monsters_dataframe()`, etc.


---

Features

-  Query spells, monsters, classes, races, and magic items  
-  Retrieve single entries by name or slug  
-  Fetch all paginated results automatically  
-  Convert results to pandas DataFrames for analysis  
-  Dataclass models capture all known fields + flexible “extras”  
-  Built using `requests` and standard Python libraries

---

##  Installation

Clone the repository and install in editable mode:

```bash
git clone <your_repo_url>
cd open5e_client_project
python -m pip install -e .

##QUICK START

from open5e_client import Open5eClient

client = Open5eClient()

# List first 5 evocation spells
spells = client.list_spells(school="Evocation", limit=5)
for s in spells:
    print(s.name, s.level)

# Retrieve a single monster
dragon = client.get_monster("adult-blue-dragon")
print(dragon.name, dragon.armor_class)


##USAGE EXAMPLES

spells = client.list_spells(level=3)
fireball = client.get_spell("fireball")
all_spells = client.list_all_spells()

##Dataframes 

df_spells = client.spells_dataframe()

#PROJECT STRUCTURE

open5e_client_project/
│
├── open5e_client/
│   ├── __init__.py
│   ├── client.py
│   ├── models.py
│   └── ...
│
├── tests/
│   └── (optional pytest files)
│
├── examples/
│   └── open5e_demo.ipynb
│
└── README.md
bignum 0.1.3
A small, easy-to-use wrapper around Python's Decimal with configurable precision and rounding.
License: MIT
Requires Python: >=3.7

# Bignum — Arbitrary-Precision Decimal Numbers for Python

`Bignum` is a tiny wrapper around Python’s built-in [`decimal.Decimal`](https://docs.python.org/3/library/decimal.html) type.

It gives you:

- Easy, consistent handling of **big numbers** (money, crypto, prices, etc.)
- **Configurable precision** (`DP`) and **rounding mode** (`RM`)

Perfect when `float` is too imprecise and you want something safer but still easy to use.

---

## Features

- ✅ Arbitrary-precision decimal arithmetic  
- ✅ Global defaults for decimal places (`DP`) and rounding mode (`RM`)  
- ✅ Minimal, focused API  
- ✅ Works with `str`, `int`, `float`, `Decimal`, and `Big` values  

---

## Installation

If you’ve published this as a package:

```bash
pip install bignum
```

## Quick Start

```python
from bignum import Big

# Basic construction
a = Big("0.1")
b = Big("0.2")

# Addition
c = a + b
print(c)           # -> 0.3

# Or using methods, if you added them:
# c = a.add(b)

# Multiplication
d = Big("1.23") * Big("4")
print(d)           # -> 4.92
```

Because Big uses Decimal under the hood, you don’t get the usual floating-point surprises:

```python
from bignum import Big

print(0.1 + 0.2)        # 0.30000000000000004 (float)
print(Big("0.1") + Big("0.2"))  # 0.3 (Big)
```

## Configuration

`Big` exposes two important global settings:

```python
from bignum import Big

# Maximum decimal places for division, sqrt, etc.
Big.DP = 20    # default: 20

# Rounding mode (like big.js)
# 0: ROUND_DOWN
# 1: ROUND_HALF_UP      (default)
# 2: ROUND_HALF_EVEN
# 3: ROUND_UP
Big.RM = 1
```

Internally, these map to decimal’s rounding modes via _ROUND_MAP.

You can also use decimal.localcontext() for temporary precision overrides inside your own code, but for most use cases, setting Big.DP and Big.RM is enough.

## Creating Big Numbers

```python
from bignum import Big
from decimal import Decimal

Big("1.2345")         # from string
Big(12345)            # from int
Big(1.2345)           # from float (not recommended for exact finance values)
Big(Decimal("1.2345"))# from Decimal
Big(Big("1.2345"))    # from another Big
```

Under the hood, the constructor converts the value to a Decimal and stores it as self._d.

## Arithmetic

The exact API here depends on how you implemented `Big`.

Below is a typical pattern using operator overloading.

### Addition

```python
x = Big("1.1")
y = Big("2.2")
print(x + y)      # -> 3.3
```

### Subtraction

```python
x = Big("5")
y = Big("2.5")
print(x - y)      # -> 2.5
```

### Multiplication

```python
x = Big("1.5")
y = Big("3")
print(x * y)      # -> 4.5
```

### Division

Division respects Big.DP and Big.RM:

```python
from bignum import Big

Big.DP = 10
Big.RM = 1  # ROUND_HALF_UP

x = Big("1")
y = Big("3")

print(x / y)  # -> 0.3333333333  (10 decimal places)
```

## License

MIT License

Copyright (c) 2025 kent-griffin