An enhanced version of Pydantic's BaseModel, allowing for advanced model manipulations.
Project description
# Pydantic-Set-Operations
Pydantic-Set-Operations provides an enhanced version of Pydantic's BaseModel, allowing for advanced model manipulations, such as field unions, exclusions, and intersections. ExtendedBaseModel introduces bitwise operations (like |, &, and -) for combining, intersecting, and excluding fields between models.
This package is ideal for projects that require dynamic model restructuring or filtering based on specific fields.
Key Model Features
- Field Union (
unionmethod): Combines fields from two models, prioritizing fields from the initiating model if overlaps exist. - Field Exclusion (
omitmethod): Creates a new model excluding specified fields or fields present in another model. - Field Intersection (
pickmethod): Creates a model containing only fields shared between two models.
Key Instance Features
- Field Union (
|operator): Returns an instance combining fields from both instances. - Field Exclusion (
-operator): Returns an instance excluding fields present in another instance. - Field Intersection (
&operator): Returns an instance containing only fields shared between two instances.
Installation
Install using pip install -U pydantic-set-operations.
Usage
For more info about how to use this package, please visit the Wiki.
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
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 pydantic_set_operations-1.0.8.tar.gz.
File metadata
- Download URL: pydantic_set_operations-1.0.8.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c990f2e59059b231f6e8b7d95416397db16914192479487bd49960d06cc375d9
|
|
| MD5 |
1226f5f3b0eca44bec670534b865c4f8
|
|
| BLAKE2b-256 |
63743795d4a4ceaf3d508d66ac760a7f927aa691a50e5162b96d183abd8f29cd
|
File details
Details for the file pydantic_set_operations-1.0.8-py3-none-any.whl.
File metadata
- Download URL: pydantic_set_operations-1.0.8-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8f0db33bead1da40d7578959345f2c76414d0e76e9135dfe9797dd4f0af295d
|
|
| MD5 |
8efe969bd530ceb9492f321dc387bcfe
|
|
| BLAKE2b-256 |
69d424c2f64cf2061b1f7c5feff8fef61267de4e4ca6b8183824cc233b9c7cb4
|