Skip to main content

CI codecov

Extendable Pydantic

This addons provides a new type used to declare Pydantic model as Extendable class.

From release 1.0.0 it only supports Pydantic >= 2.0.0.

from pydantic import BaseModel
from extendable_pydantic import ExtendableModelMeta
from extendable import context, registry

class Location(BaseModel, metaclass=ExtendableModelMeta):
    lat = 0.1
    lng = 10.1

class ExtendedLocation(Location, extends=Location):
    name: str

_registry = registry.ExtendableClassesRegistry()
context.extendable_registry.set(_registry)
_registry.init_registry()

loc = Location(**{"lat": 12.3, "lng": 13.2, "name": "My Loc"})

loc.model_dump() == {"lat": 12.3, "lng": 13.2, "name": "My Loc"}
#> True

loc.model_json_schema()
#> {'title': 'Location', 'type': 'object', 'properties': {'lat': {'title': 'Lat', 'default': 0.1, 'type': 'number'}, 'lng': {'title': 'Lng', 'default': 10.1, 'type': 'number'}, 'name': {'title': 'Name', 'type': 'string'}}, 'required': ['name']}

Development

pip install -e .

Then, copy extendable_pydantic_patcher.pth to $VIRTUAL_ENV/lib/python3.10/site-packages.

Release

  • run ``bumpversion patch|minor|major --list
  • Check the new_version value returned by the previous command
  • run towncrier build.
  • Inspect and commit the updated HISTORY.rst.
  • git tag {new_version} ; git push --tags.

Metadata

Release files for extendable-pydantic 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for extendable-pydantic 1.4.0
File Size Uploaded
extendable_pydantic-1.4.0.tar.gz 8.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for extendable-pydantic 1.4.0
File Interpreter ABI Platform
extendable_pydantic-1.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.6 kB

Release files / extendable_pydantic-1.4.0.tar.gz

Download URL extendable_pydantic-1.4.0.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
341ec48c284928c778dd55f3da8a1db3d650f6873d5f49701132668953fdffee
BLAKE2b-256 checksum
How to use checksums
a420746c1aaa00a0770579aa773d7777c39be8d40f2284219bce6becd36152cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 16, 2025.

Transparency log

Release files / extendable_pydantic-1.4.0-py3-none-any.whl

Download URL extendable_pydantic-1.4.0-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7daede6528250d8adffc16a01df515c90035d2f2963bcceede3ad16035078b8
BLAKE2b-256 checksum
How to use checksums
594eefcec3127b0f82822c444d1ed9759b1c703f20a69c29fa61184dcafaa9bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 16, 2025.

Transparency log

Release history Release notifications | RSS feed

1.4.1

2 release files

This release

1.4.0 This release

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

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