Skip to main content

qt-pydantic

The qt-pydantic package adds support for Qt types in Pydantic BaseModels. Using these annotations allows for easy serialization and deserialization of Qt types.

Installation

Install using pip:

pip install qt-pydantic

Usage

from PySide6 import QtCore, QtGui
from pydantic import BaseModel
from qt_pydantic import QSize, QColor, QDate


# Define a model with Qt types
class Settings(BaseModel):
    size: QSize
    date: QDate
    color: QColor


# Parse json string into model
json_data = '{"size": [720, 480], "date": "2021-01-01", "color": [255, 95, 135]}'
settings = Settings.model_validate_json(json_data)

# Model types are actual Qt types
assert isinstance(settings.size, QtCore.QSize)
assert isinstance(settings.date, QtCore.QDate)
assert isinstance(settings.color, QtGui.QColor)

# Turn model into json string
data = settings.model_dump_json(indent=2)

Contributing

To contribute please refer to the Contributing Guide.

License

MIT License. Copyright 2026 - Beat Reichenbach. Seef the License file for details.

Metadata

Release files for qt-pydantic 0.1.2

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

Source distribution (sdist)

Source distribution for qt-pydantic 0.1.2
File Size Uploaded Provenance Actions
qt_pydantic-0.1.2.tar.gz 6.3 kB With provenance Details for qt_pydantic-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for qt-pydantic 0.1.2
File Interpreter ABI Platform Actions
qt_pydantic-0.1.2-py3-none-any.whl Python 3 none any Details for qt_pydantic-0.1.2-py3-none-any.whl

Total release size: 11.1 kB

Release files / qt_pydantic-0.1.2.tar.gz

Download URL qt_pydantic-0.1.2.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d8b92bdb6f09af9f1efa8bd1fdef4662aa90758e2a8ad413bf8f11bf81858ad4
BLAKE2b-256 checksum
How to use checksums
160597b8393e4652947270c0ca59f507f5868f29b6dd820f29ada3af1ee85177
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 1, 2026.

Transparency log

Release files / qt_pydantic-0.1.2-py3-none-any.whl

Download URL qt_pydantic-0.1.2-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b041a87a20708c570f3d3e5105a32f746773741a4a78a5523e41c48d9b9a216a
BLAKE2b-256 checksum
How to use checksums
85c87e1f3edc61085d3906b2c33efdb5fe7a37b4e7979db6e61a9e7a1ec3c57e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 1, 2026.

Transparency log

Security for qt-pydantic 0.1.2

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for qt_pydantic-0.1.2.tar.gz

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 Oct 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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