summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2024-05-07 15:44:46 +0200
committerYuval Adam <_@yuv.al>2024-05-07 15:44:46 +0200
commitc0056b2d9f5175d06b39834b013d16fa5d63a485 (patch)
tree6391068bf0738b8e988db8d8e2ebe2c1ccda5396 /README.md
parent7bb5dc320e12ecdbb6cf514b11306df130e8a24c (diff)
Setup pytest and assert stash path
Diffstat (limited to 'README.md')
-rw-r--r--README.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/README.md b/README.md
index e289a88..ee3df48 100644
--- a/README.md
+++ b/README.md
@@ -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)
+```