Skip to main content

Pydantic-fetch

Extension of pydantic.BaseModel which supports sending and parsing from HTTP endpoints.

Description

BaseModel is extended with two class functions:

  • fetch to recieve a json payload from an endpoint and validate it as the pydantic model
  • submit to 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)

Source distribution for pydantic-fetch 0.0.3
File Size Uploaded
pydantic-fetch-0.0.3.tar.gz 3.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pydantic-fetch 0.0.3
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page