diff options
| author | Yuval Adam <_@yuv.al> | 2024-05-07 15:44:46 +0200 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2024-05-07 15:44:46 +0200 |
| commit | c0056b2d9f5175d06b39834b013d16fa5d63a485 (patch) | |
| tree | 6391068bf0738b8e988db8d8e2ebe2c1ccda5396 /README.md | |
| parent | 7bb5dc320e12ecdbb6cf514b11306df130e8a24c (diff) | |
Setup pytest and assert stash path
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -5,9 +5,26 @@ A simple ORM-like utility for operating on local YAML files via Python dataclass Define a dataclass: ```python +from dataclasses import dataclass + @dataclass class User: name: str age: int active: bool ``` + +Instantiate a new object: + +```python +user = User(name="yuval", age=42, active=True) +``` + +Save it to file: + +```python +from ymlstash import YmlStash + +stash = YmlStash("path/to/db") +stash.save(user) +``` |
