Metadata-Version: 2.4
Name: azrideus-vault
Version: 0.1.0
Summary: Obsidian vault helpers: markdown documents with YAML frontmatter, and git sync.
License-Expression: MIT
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: pydantic>=2.7
Requires-Dist: pyyaml>=6
Provides-Extra: dev
Requires-Dist: ruff; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: types-PyYAML; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"

# azrideus-vault

Small helpers for an Obsidian vault.

- `Document(path=...)`: one markdown file. `read()` returns the YAML frontmatter (integer strings become ints), `write({...})` merges keys into it (`None` deletes a key) and keeps the body, `tags()` collects `#tags` from the body and the `tags` frontmatter key.
- `VaultGit(root, token="", identity="azrideus-vault")`: async `pull()` (merge only; aborts on conflict), `commit()`, `push()` and `is_dirty()`. A GitHub token is passed through a credential helper and never shows up in URLs or output.
- `Vault(root=...)`: worlds are folders under `worlds/` with a `WORLD_SETTINGS.md`; `scan(world_dir)` sorts `#player`/`#npc`/`#monster`/`#unit`/`#item` documents into a `VaultScan` (shared monsters come from `0.0 - Documents/`).
- `VaultSync.pull_and_reload(git, worlds, vault)`: pull, then reload every world, reporting broken ones instead of stopping.
- `VaultError`: every error raised; `.message` is safe to show to a user.

```python
from pathlib import Path
from azrideus_vault import Document

doc = Document(path=Path("vault/Notes/Bob.md"))
doc.write({"hp": 12})
print(doc.read()["hp"], doc.tags())
```

Tests: `python -m unittest discover -s tests -t . -v`
