todo
Project description
pydantic-basedtyping
support for basedtyping features with pydantic:
from __future__ import annotations
from pydantic import BaseModel
class A(BaseModel):
a: 1 | 2
A(a=1) # A(a=1)
A(a=2) # A(a=2)
A(a=3) # ValidationError
[!NOTE] the types need to be written as a string, or
__future__.annotations
needs to be enabled
installation
- add
pydantic-basedtyping
as a dependency - install the plugin with:
python -m pydantic_basedtyping install
if you are using pyprojectx, this can be configured:
[tool.pyprojectx]
install = ["uv sync", "uv run python -m pydantic_basedtyping install"]
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
Built Distribution
File details
Details for the file pydantic_basedtyping-0.1.0.tar.gz
.
File metadata
- Download URL: pydantic_basedtyping-0.1.0.tar.gz
- Upload date:
- Size: 26.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.26
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73bf29f6f566bb51966a3da48a95b7f435d090ad3e0cb6997afe3cb3ba356663 |
|
MD5 | 8202ffd892d36f411d406b3eff419920 |
|
BLAKE2b-256 | 7367f49f6f9d27e5bd5cfe22a28f6f4eab6dd6035ce598eb255969aeca0a6b54 |
File details
Details for the file pydantic_basedtyping-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: pydantic_basedtyping-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.26
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5117fda05606d36aca135dd4eb0dafaee971778e1d03652dfbfb189d55602cc0 |
|
MD5 | 7b1fcb4e4d0cc8c778f010be544ba966 |
|
BLAKE2b-256 | d4168fe3af10ebf003dbe834755ebbec19ee801225eb9bf2de6e4384de04b147 |