Skip to main content

A Python package that standardizes data serialization and deserialization from/to pydantic models.

Project description

pydantic-serdes

pydantic-serdes is a Pydantic-based tool designed to act as a conduit between serialized data and Python objects. It not only facilitates the transformation of complex serialized data into Python objects, but also ensures stringent data validation. Think of it as the wizard that transports your data from the realm of serialization into the world of Python, and vice-versa, all the while maintaining the integrity and structure of your data.

DISCLAMER: Please note that this package was previously named serial_bus until version 0.2.0. To improve communication and disambiguation, it has been renamed to pydantic-serdes.

Install

pip:

pip install pydantic-serdes

poetry:

poetry add pydantic-serdes

Features

  • Pydantic Integration: Converting serialized data into Python objects is the oldest trick in the book, but pydantic-serdes elevates this process by directly converting the data into Pydantic models (and vice-versa), which brings the added advantage of robust data validation. The models used in this process are defined by classes that inherit from either the PydanticSerdesBaseModel or PydanticSerdesRenderableModel. This not only provides flexibility in setting up behaviors for your data, but also ensures data integrity through Pydantic's validation mechanisms.

  • Built-in Support for Multiple Formats: Currently, it supports loading serialized data from JSON, YAML, TOML and INI. While future support for other formats is planned, if you need to cover additional formats, or even provide your own parsing business logic, this can be easily achieved by extending pydantic-serdes basic coverage with your own loader and/or dumper functions. Speaking of which...

  • Extensibility: The code was thought to allow for ease of extensibility. For more information and examples, refer to the documentation below.

pydantic-serdes

Quick Start

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydantic_serdes-1.0.5.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydantic_serdes-1.0.5-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file pydantic_serdes-1.0.5.tar.gz.

File metadata

  • Download URL: pydantic_serdes-1.0.5.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.11.6 Darwin/25.4.0

File hashes

Hashes for pydantic_serdes-1.0.5.tar.gz
Algorithm Hash digest
SHA256 ea15ee35b5fff4bd27d7e64c6f0d76d0a3c2cf53ba5eb10dae97a59afb14321c
MD5 0c92c71fcf238afdafe8bfbb9bb83ad0
BLAKE2b-256 5015eb5fbfb34c1e7bac396f98dfcd656316d97c698153a01dd11fee5bc3d076

See more details on using hashes here.

File details

Details for the file pydantic_serdes-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: pydantic_serdes-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.11.6 Darwin/25.4.0

File hashes

Hashes for pydantic_serdes-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d3bcb91ec08896a1c3b8479db7c307e9377f85d8e83891e0936b3373e51bf1b1
MD5 1be00e9f79fe31f9f57bf451dca729fc
BLAKE2b-256 4133703e0045973abeb9de6d7bf163e4fc3835dffa0f5917ee7152240989ce8a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page