stele1-datatypes
Core datatypes for stele1 catalogs.
Covers Metadata, Climb, Area, Photo, Parking, and Trail.
See the stele1 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
from uuid import uuid4
from stele1.climb import Climb
# from existing data
climb = Climb.from_data({
'uuid': '550e8400-e29b-41d4-a716-446655440000',
'name': 'Centerpede',
'rating': {'difficulty': 'V4'},
})
# or built up directly
other = Climb(uuid4())
other.name = 'Millipede'
other.rating = {'difficulty': 'V5'}
climb.name # 'Centerpede'
climb.name = 'Centerpede Low'
climb.rating = None # remove an attribute
climb.to_data() # plain dict, ready for json.dumps
Attributes are plain values: strings, numbers, tuples, dicts.
Assigning validates immediately;
invalid values raise TypeError or ValueError at the assignment,
naming the problem:
climb.length = {'lower_estimate': 3, 'upper_estimate': 2, 'unit': 'meters'}
# ValueError: climb .length lower_estimate must not exceed upper_estimate
Every record requires a uuid at construction.
uuid.UUID instances are accepted and stored
as the canonical lowercase string.
to_data returns fresh plain dicts.
json.dumps(climb.to_data()) produces spec-compliant output;
formatting is up to the caller.
Sequence attributes are returned as tuples;
to change one, assign a new value:
climb.tags = [*(climb.tags or ()), 'highball']
Attribute validators
Each datatype module also exposes its attribute validators, usable on their own:
from stele1.climb import validate_rating
validate_rating({'difficulty': 'V12'}) # returns the validated value
validate_rating({}) # raises ValueError
Compatibility behavior
Per the spec's versioning rules:
unknown top-level attributes are preserved verbatim
through from_data / to_data,
and unknown nested keys raise.
Some checks here are deliberately stricter than the spec;
they are marked beyond spec in the source.
To read records that this strictness rejects,
use DictCatalog from
stele1-filesystem.
Install
pip install stele1-datatypes
Development
Source and issues live at codeberg.org/stele-climbing/stele1.
License
MIT
Metadata
Release files for stele1-datatypes 0.3.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| stele1_datatypes-0.3.8.tar.gz | 12.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| stele1_datatypes-0.3.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.5 kB
Release files / stele1_datatypes-0.3.8.tar.gz
| Download URL | stele1_datatypes-0.3.8.tar.gz |
|---|---|
| Size | 12.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
58c134ca948f23122c884e9c27a38e746a23aac5cec83b20bb311b103ed3a155
|
|
BLAKE2b-256 checksum How to use checksums |
63307cc34023a6a7b2e7a2d2187faa6044a91b26bf6ed5c8dc856e6c54322340
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / stele1_datatypes-0.3.8-py3-none-any.whl
| Download URL | stele1_datatypes-0.3.8-py3-none-any.whl |
|---|---|
| Size | 16.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
877abf6474852ee669fac95f8b701af92befabe721f821d99b38fc8ac74c9729
|
|
BLAKE2b-256 checksum How to use checksums |
f5144122905cea6fba4b47f0b8d9ad5686711db2fadccf86447854c124e39304
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Security for stele1-datatypes 0.3.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.