diff options
| author | Yuval Adam <_@yuv.al> | 2024-05-07 20:55:09 +0200 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2024-05-07 20:56:12 +0200 |
| commit | 7dfd130b1c0bd909b604e2273792f840be4decee (patch) | |
| tree | 103ad199a65c370ac070601808f0dfdf291cc628 /README.md | |
| parent | 3ebf529934ad4932a0dd7deeffa31c4deee2e72d (diff) | |
Finalize key field functionality
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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: |
