{"id":4414,"library":"airbyte-protocol-models-dataclasses","title":"Airbyte Protocol Dataclass Models","description":"This library declares the Airbyte Protocol using Python Dataclasses. It is designed for scenarios where speed and memory usage are critical, offering less performance overhead compared to Pydantic models. The library is actively maintained with frequent updates, typically released monthly, in alignment with the broader Airbyte platform. The current version is 0.18.0.","status":"active","version":"0.18.0","language":"python","source_language":"en","source_url":"https://github.com/airbytehq/airbyte-protocol","tags":["data integration","ETL","protocol","dataclasses","airbyte"],"install":[{"cmd":"pip install airbyte-protocol-models-dataclasses","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"Airbyte Protocol models are typically namespaced under `v0.models` within the package, reflecting the current stable protocol version.","symbol":"AirbyteMessage","correct":"from airbyte_protocol_models_dataclasses.v0.models import AirbyteMessage"},{"symbol":"AirbyteRecordMessage","correct":"from airbyte_protocol_models_dataclasses.v0.models import AirbyteRecordMessage"},{"symbol":"Type","correct":"from airbyte_protocol_models_dataclasses.v0.models import Type"}],"quickstart":{"code":"import json\nfrom dataclasses import asdict\nfrom datetime import datetime\nfrom airbyte_protocol_models_dataclasses.v0.models import AirbyteMessage, AirbyteRecordMessage, Type\n\n# Create an AirbyteRecordMessage representing a data record\nrecord_data = {\n    \"id\": 1,\n    \"name\": \"Test User\",\n    \"email\": \"test.user@example.com\",\n    \"created_at\": datetime.now().isoformat()\n}\nrecord_message = AirbyteRecordMessage(\n    stream=\"users\",\n    data=record_data,\n    emitted_at=int(datetime.now().timestamp() * 1000),\n)\n\n# Wrap the record in a top-level AirbyteMessage\nairbyte_message = AirbyteMessage(\n    type=Type.RECORD,\n    record=record_message,\n)\n\n# Convert the dataclass instance to a dictionary and then to a JSON string\njson_output = json.dumps(asdict(airbyte_message), indent=2)\nprint(\"\\n--- Airbyte Record Message ---\")\nprint(json_output)\n\n# Example of creating an AirbyteStateMessage\nstate_data = {\"users_sync_progress\": {\"last_id\": 100, \"updated_at\": datetime.now().isoformat()}}\nstate_message = AirbyteMessage(\n    type=Type.STATE,\n    state=state_data,\n)\n\n# Serialize the state message\njson_state_output = json.dumps(asdict(state_message), indent=2)\nprint(\"\\n--- Airbyte State Message ---\")\nprint(json_state_output)","lang":"python","description":"This quickstart demonstrates how to construct basic Airbyte Protocol messages (Record and State) using the dataclass models. It shows how to create a `AirbyteRecordMessage` and `AirbyteStateMessage`, wrap them in a generic `AirbyteMessage`, and then serialize them to JSON format for inter-process communication, which is standard for the Airbyte Protocol. All fields are expected to be correctly typed according to the protocol's JSON schema."},"warnings":[{"fix":"Migrate all protocol model usage to the `v0` namespace, e.g., `from airbyte_protocol_models_dataclasses.v0.models import ...`.","message":"Protocol V1 models have been removed starting from version 0.17.0. Code relying on `v1` namespaces or structures will break.","severity":"breaking","affected_versions":">=0.17.0"},{"fix":"Update any code that accesses or creates catalog configurations to use the `json-schema` field name instead of `schema`.","message":"The field name 'schema' was renamed to 'json-schema' in version 0.16.0. This affects how catalog objects are structured and accessed.","severity":"breaking","affected_versions":">=0.16.0"},{"fix":"Implement explicit type checking and validation logic if strict runtime validation is required, or consider using `airbyte-protocol-models-pdv2` if Pydantic's features are essential and the performance trade-off is acceptable.","message":"This library uses Python's native dataclasses for protocol models, explicitly to reduce performance overhead compared to Pydantic. Users accustomed to Pydantic's features (e.g., automatic type coercion, runtime validation, custom validators) will find these are not natively available.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-05-22T07:57:20.252Z","next_check":"2026-07-11T00:00:00.000Z","problems":[{"fix":"Install the package using pip: 'pip install airbyte-protocol-models-dataclasses'.","cause":"The 'airbyte-protocol-models-dataclasses' package is not installed in the Python environment.","error":"ModuleNotFoundError: No module named 'airbyte_protocol_models_dataclasses'"},{"fix":"Verify the correct class name and import statement by referring to the official documentation.","cause":"The 'AirbyteMessage' class does not exist in the 'airbyte_protocol_models_dataclasses' module.","error":"ImportError: cannot import name 'AirbyteMessage' from 'airbyte_protocol_models_dataclasses'"},{"fix":"Ensure all required fields are provided when initializing the dataclass instance.","cause":"An instance of a dataclass from 'airbyte_protocol_models_dataclasses' is being initialized without providing all required fields.","error":"TypeError: __init__() missing 1 required positional argument: 'type'"},{"fix":"Ensure that 'to_dict()' is called on an instance of a dataclass from 'airbyte_protocol_models_dataclasses', not a regular dictionary.","cause":"Attempting to call 'to_dict()' on a dictionary object instead of a dataclass instance.","error":"AttributeError: 'dict' object has no attribute 'to_dict'"},{"fix":"Assign a valid value to the enum field as defined in the dataclass's documentation.","cause":"An invalid value is being assigned to an enum field in a dataclass from 'airbyte_protocol_models_dataclasses'.","error":"ValueError: Invalid enum value 'UNKNOWN' for field 'status'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.18.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/airbytehq/airbyte-protocol","docs":"https://docs.airbyte.io/","changelog":null,"pypi":"https://pypi.org/project/airbyte-protocol-models-dataclasses/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data"],"base_url":null,"auth_type":null,"install_checks":{"last_tested":"2026-05-22","tag":null,"tag_description":null,"installed_version":"0.18.0","pypi_latest":"0.18.0","is_stale":false,"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"airbyte-protocol-models-dataclasses","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"17.8M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"airbyte-protocol-models-dataclasses","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.6,"import_time_s":null,"mem_mb":null,"disk_size":"18M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"airbyte-protocol-models-dataclasses","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"19.7M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"airbyte-protocol-models-dataclasses","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.6,"import_time_s":null,"mem_mb":null,"disk_size":"20M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"airbyte-protocol-models-dataclasses","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"11.5M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"airbyte-protocol-models-dataclasses","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.4,"import_time_s":null,"mem_mb":null,"disk_size":"12M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"airbyte-protocol-models-dataclasses","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"11.3M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"airbyte-protocol-models-dataclasses","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.4,"import_time_s":null,"mem_mb":null,"disk_size":"12M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"airbyte-protocol-models-dataclasses","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"17.3M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"airbyte-protocol-models-dataclasses","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.7,"import_time_s":null,"mem_mb":null,"disk_size":"18M"}]},"_links":{"self":"https://checklist.day/api/registry/airbyte-protocol-models-dataclasses","v1":"https://checklist.day/v1/registry/airbyte-protocol-models-dataclasses","v1_install":"https://checklist.day/v1/registry/airbyte-protocol-models-dataclasses/install","v1_imports":"https://checklist.day/v1/registry/airbyte-protocol-models-dataclasses/imports","v1_compatibility":"https://checklist.day/v1/registry/airbyte-protocol-models-dataclasses/compatibility","v1_quickstart":"https://checklist.day/v1/registry/airbyte-protocol-models-dataclasses/quickstart","docs":"https://checklist.day/docs"}}