A small example package
Project description
JsonHandler
This is a simple package that allows you to store nested Model objects in a JSON file. Completely asynchronous and allows the json file to be edited then rebooted.
Example Usage:
class People(CustomModel):
name: Name
age: int
class Name(CustomModel):
first: str
last: str
class Data(CustomModel):
people: list[People]
json_handler = JsonHandler(Data, "data.json")
# prints the first name of the first person
if json_handler.data.people:
print(json_handler.data.people[0].name.first)
else:
# if there is no data, add some
json_handler.data.people.append(People(name=Name(first="John", last="Doe"), age=30))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jsonhandlerdb-0.0.2.tar.gz
(4.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jsonhandlerdb-0.0.2.tar.gz.
File metadata
- Download URL: jsonhandlerdb-0.0.2.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd7d80d58942944c262c8a006b3f6947fe4828df92126d96aaea3e8c355b4e0a
|
|
| MD5 |
074146baeb3188d838920d12fa02850f
|
|
| BLAKE2b-256 |
cf66f8947776a01d3b66f9ca73816b8c01d37d5b118be74a661171df17d20d47
|
File details
Details for the file jsonhandlerdb-0.0.2-py3-none-any.whl.
File metadata
- Download URL: jsonhandlerdb-0.0.2-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e2a7677a278a0ba5133da482f264257cffbbe882d09b469efc2793b43a92f5a
|
|
| MD5 |
cf091b931f48603358457c727162b21e
|
|
| BLAKE2b-256 |
c34a88483deba96435ced5ff18307a4e0a0b4eca3362762c93269cfca5ea7661
|