Pydantic DbModel Core
Overview
The pydantic-dbmodel-core library presents the DbModelCore class, an augmentation of the BaseModel class from Pydantic. This enhancement is achieved through a change in the ModelMetaclass meta-class, enabling the coexistence of class variables and instance variables with identical names. This feature, available in Pydantic V1 but absent in Pydantic V2, has been reintroduced with this small yet crucial modification.
Installation
To install pydantic-dbmodel-core, run the following command:
pip install pydantic-dbmodel-core
Usage
Import the DbModelCore class from the library and use it as you would use Pydantic's BaseModel.
from pydantic_dbmodel_core import DbModelCore
class YourModel(DbModelCore):
# Define your fields here
pass
Features
- Allows the definition of class variables with the same name as instance variables.
- Fully compatible with Pydantic's field definitions and validators.
Metadata
Release files for pydantic-dbmodel-core 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_dbmodel_core-0.0.3.tar.gz | 9.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pydantic_dbmodel_core-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.8 kB
Release files / pydantic_dbmodel_core-0.0.3.tar.gz
| Download URL | pydantic_dbmodel_core-0.0.3.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c782eda08484079d841220b0472d77836637b67c15a94a9b2a1057722ea96c62
|
|
BLAKE2b-256 checksum How to use checksums |
9eb9e56281d8f845424712667f1ffa0e3fc2045e9e6afe8ab9a21c9735a723ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / pydantic_dbmodel_core-0.0.3-py3-none-any.whl
| Download URL | pydantic_dbmodel_core-0.0.3-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9524def9945aeee0ddb3f34c7e7baa0e2bfb01aaf3bc89c146538df00447f419
|
|
BLAKE2b-256 checksum How to use checksums |
68a04b8f009a068d3faf7dbfad342b634a59ac4dfc3d306a75a516d06aea395f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|