summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2024-05-07 20:55:09 +0200
committerYuval Adam <_@yuv.al>2024-05-07 20:56:12 +0200
commit7dfd130b1c0bd909b604e2273792f840be4decee (patch)
tree103ad199a65c370ac070601808f0dfdf291cc628 /README.md
parent3ebf529934ad4932a0dd7deeffa31c4deee2e72d (diff)
Finalize key field functionality
Diffstat (limited to 'README.md')
-rw-r--r--README.md6
1 files changed, 4 insertions, 2 deletions
diff --git a/README.md b/README.md
index 9cfc571..25737d2 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,8 @@
A simple ORM-like utility for operating on local YAML files via Python dataclasses.
+## Usage
+
Define a dataclass:
```python
@@ -16,7 +18,7 @@ class User:
key: ClassVar[str] = "name"
```
-Note the `key` field which is used to denote that `name` should be used as the primary key field.
+Note the special `key` field which is used to denote that `name` should be used as the primary key field.
Instantiate a new object:
@@ -30,7 +32,7 @@ Save it to file:
from ymlstash import YmlStash
stash = YmlStash(User, "path/to/db")
-stash.save("yuval", user)
+stash.save(user)
```
Load from file: