Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tombulled/pydantabase
Pydantic integration for TinyDB
https://github.com/tombulled/pydantabase
Last synced: 23 days ago
JSON representation
Pydantic integration for TinyDB
- Host: GitHub
- URL: https://github.com/tombulled/pydantabase
- Owner: tombulled
- License: mit
- Created: 2021-04-08T19:13:45.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-09T14:06:21.000Z (almost 3 years ago)
- Last Synced: 2023-03-05T18:53:57.877Z (almost 2 years ago)
- Language: Python
- Homepage:
- Size: 9.77 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pydantabase
Pydantic integration for TinyDB## Example:
```python
import pydantabase
import tinydb.storagesclass Person(pydantabase.BaseModel):
name: str
age: intclass Database(pydantabase.Database):
default_storage_class = tinydb.storages.MemoryStorage
db = Database(Person)db.insert_multiple([
Person(
name = 'Paul',
age = 53,
),
Person(
name = 'Rebecca',
age = 47,
),
])
``````python
>>> db.get(tinydb.Query().name == 'Paul')
Person(name='Paul', age=53)
```