Registry / serialization / airbyte-protocol-models-pdv2

airbyte-protocol-models-pdv2

JSON →
library0.18.0pypypi✓ verified 23d ago

This library provides Pydantic v2 models that declare the Airbyte Protocol. It defines the structured messages (like records, states, logs, and catalogs) used for inter-process communication between Airbyte sources, destinations, and the platform. It is currently at version 0.19.0 and receives frequent updates, often adding new features and protocol extensions.

pip install airbyte-protocol-models-pdv2
INSTALL
IMPORT
SIG · AIRBYTE-PROTOCOL-M
A
airbyte-protocol-models-pdv2
serializationpythonv0.18.0
Install
3.3s avg
Import
Disk
26MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.18.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 27.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.3s · import 0.000s · 28MB
26MB installed
● package 26MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AirbyteMessage
from airbyte_protocol import AirbyteMessage
from airbyte_protocol import AirbyteMessage

This quickstart demonstrates how to create an `AirbyteRecordMessage`, wrap it within an `AirbyteMessage` envelope, serialize it to a JSON string, and then deserialize it back into a Pydantic object. This is fundamental for interacting with the Airbyte Protocol, where all messages are exchanged as JSON.

import json from airbyte_protocol_models_pdv2.airbyte_protocol import AirbyteMessage, AirbyteRecordMessage, Type # Create a sample record message record_data = {"id": 1, "name": "Alice", "age": 30} record_message = AirbyteRecordMessage( stream="users", data=record_data, emitted_at=1678886400000 # Unix timestamp in milliseconds ) # Wrap it in an AirbyteMessage envelope airbyte_message = AirbyteMessage( type=Type.RECORD, record=record_message ) # Serialize the message to JSON (as expected by the Airbyte Protocol) json_output = airbyte_message.model_dump_json(by_alias=True) print("Serialized JSON message:") print(json_output) # Deserialize the JSON back into an AirbyteMessage object deserialized_message = AirbyteMessage.model_validate_json(json_output) print("\nDeserialized message type:", deserialized_message.type) if deserialized_message.record: print("Deserialized record data:", deserialized_message.record.data)
Debug
Known issues
breakingThis library (`-pdv2`) is built exclusively on Pydantic v2. If your project or other dependencies use Pydantic v1, mixing these models can lead to runtime errors or unexpected behavior due to API changes and incompatibility between Pydantic versions.
fix
Ensure your entire project ecosystem is compatible with Pydantic v2. Migrate any existing Pydantic v1 models to v2, or isolate the use of this library in environments where Pydantic v1 is not present.
affects: All versions
breakingProtocol v1 models have been removed. Versions v0.17.0, v0.14.5, and v0.14.4 explicitly include changes to remove or move V1 models.
fix
Update your code to use the latest protocol models, which are implicitly v0 (or the current major version of the protocol), and avoid any references to explicitly named V1 models.
affects: >=0.14.4
breakingThe field 'schema' was renamed to 'json_schema' in the protocol models.
fix
If you were directly accessing or manipulating a 'schema' field on any protocol model, update your code to use 'json_schema' instead.
affects: >=0.16.0
gotchaThe Airbyte Protocol is versioned independently of the main Airbyte Platform. This means that upgrading one does not automatically guarantee compatibility with the other.
fix
Always check the compatibility matrix between your Airbyte Platform version and the Airbyte Protocol version (implied by the `airbyte-protocol-models-pdv2` library version) to avoid unexpected issues. Airbyte's pre-upgrade checks are designed to help, but awareness is key.
affects: All versions
Upgrade
Version history
0.18.0latest on PyPI · released Jun 27, 2025
Audit
Dependencies
pydantic>=2requiredThe package is explicitly built on Pydantic v2 models, which is a core dependency for data validation and serialization.
Agent activity
73 hits · last 30 days
node
62
OpenAI (training)
1
Resources
airbyte-protocol-models-pdv2 — pip install airbyte-protocol-models-pdv2 · libregistry