Pydantic-fetch
Extension of pydantic.BaseModel which supports sending and parsing from HTTP endpoints.
Description
BaseModel is extended with two class functions:
fetchto recieve a json payload from an endpoint and validate it as the pydantic modelsubmitto send a pydantic model to an endpoint as a json payload.
Usage
from pydantic_fetch import BaseModel
class User(BaseModel):
id: str
name: str
def send_user(endpoint, id: str, name: str):
user = User(id=id, name=name)
user.submit(endpoint)
def get_user(endpoint):
user = User.fetch(endpoint)
Metadata
Release files for pydantic-fetch 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pydantic-fetch-0.0.3.tar.gz | 3.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pydantic_fetch-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.5 kB
Release files / pydantic-fetch-0.0.3.tar.gz
| Download URL | pydantic-fetch-0.0.3.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
28aeb0379b2e99e3138c3465d9b3e3ded9facf9aa931b082e152ed75c8f17aae
|
|
BLAKE2b-256 checksum How to use checksums |
cd6408af5187fc2eed8a4c1d1a954e156d330ed7a7dee60702f82e979b6c2343
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.2
|
Release files / pydantic_fetch-0.0.3-py3-none-any.whl
| Download URL | pydantic_fetch-0.0.3-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
41594fced7e6ea5fd549993c59b95fed6de03b4b35c24a0fd0ec9feffc4b9bf9
|
|
BLAKE2b-256 checksum How to use checksums |
0097a567940d9c5f6a58b54d0b24e315d81612a9dd06345e297ad69a26348f3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.2
|