blob: ee3df487770ab20966b8b2b1214d58ec5e671039 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# ymlstash
A simple ORM-like utility for operating on local YAML files via Python dataclasses.
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)
```
|