Metadata-Version: 2.4
Name: stele1-datatypes
Version: 0.0.1
Summary: Core datatypes for stele1 catalogs
Author-email: Daniel M <contact@steleclimbing.org>
License-Expression: MIT
Project-URL: Homepage, https://stele1.steleclimbing.org
Project-URL: Repository, https://codeberg.org/stele-climbing/stele1
Project-URL: Issues, https://codeberg.org/stele-climbing/stele1/issues
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 4 - Beta
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# stele1-datatypes

Core datatypes for [stele1](https://stele1.steleclimbing.org) catalogs.

Covers `Metadata`, `Climb`, `Area`, `Photo`, `Parking`, and `Approach`.
See the [stele1 spec](https://stele1.steleclimbing.org/spec/) for the data
model these implement.

Each datatype validates its input and exposes `from_data` / `to_data` for
serialization to and from plain dicts.

## Use

```python
from stele1.climb import Climb

climb = Climb.from_data({
    'uuid': '550e8400-e29b-41d4-a716-446655440000',
    'name': 'The Mandala',
    'rating': {'difficulty': 'V12'},
})

climb.to_data()                  # {'uuid': ..., 'name': ..., 'rating': ...}

climb.get_name().to_data()       # 'The Mandala'
```

Invalid input raises `TypeError` or `ValueError`.

`to_data` returns plain dicts.
`json.dumps(climb.to_data())` produces spec-compliant output;
formatting is up to the caller.

## Install

```
pip install stele1-datatypes
```

## License

MIT
