Metadata-Version: 2.4
Name: stele1-filesystem
Version: 0.0.1
Summary: Filesystem interface 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
Requires-Dist: stele1-datatypes>=0.0.1
Dynamic: license-file

# stele1-filesystem

Filesystem interface for [stele1](https://stele1.steleclimbing.org) catalogs.

Reads and writes catalogs on disk. Each catalog is a directory; records are
individual JSON files organized by datatype.

Exposes primitives: get, set, list, remove.
Higher-level operations (queries, traversals, indexing) are left to consumers.

## Use

```python
from stele1.filesystem import Catalog

catalog = Catalog('/path/to/catalog.stele1.d')

if not catalog.exists():
    catalog.create()

for uuid in catalog.climb_uuids():
    climb = catalog.get_climb_by_uuid(uuid)
    climb.get_name().to_data()  # 'The Mandala'
```

Each datatype (`Climb`, `Area`, `Photo`, `Parking`, `Approach`) has matching
`{type}_uuids()`, `get_{type}_by_uuid(uuid)`, `set_{type}({type})`, and
`remove_{type}_by_uuid(uuid)` methods.

Photos additionally support `get_photo_image_by_uuid` and
`set_photo_image_by_uuid` for the associated image file.

See [stele1-datatypes](https://pypi.org/project/stele1-datatypes/) for the
datatypes returned by the getters.

## Install

```
pip install stele1-filesystem
```

## License

MIT
