{"library":"pydantic-to-pyarrow","title":"Pydantic to PyArrow Schema Conversion","description":"pydantic-to-pyarrow is a Python library (current version 0.1.6) designed to facilitate the conversion of Pydantic models into Apache PyArrow schemas. It streamlines data processing pipelines by allowing validation with Pydantic and subsequent conversion to a columnar format for efficient processing with PyArrow, Pandas, or Polars, and storage in formats like Parquet. The library is actively maintained with regular feature releases.","language":"python","status":"active","last_verified":"Mon May 18","install":{"commands":["pip install pydantic-to-pyarrow"],"cli":null},"imports":["from pydantic_to_pyarrow import get_pyarrow_schema"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import pyarrow as pa\nfrom pydantic import BaseModel\nfrom typing import List, Optional\nfrom datetime import datetime\nfrom uuid import UUID\n\nfrom pydantic_to_pyarrow import get_pyarrow_schema\n\nclass Address(BaseModel):\n    street: str\n    zip_code: int\n\nclass Person(BaseModel):\n    name: str\n    age: int\n    height_cm: Optional[float]\n    is_active: bool\n    created_at: datetime\n    uuid_id: UUID\n    tags: List[str] = []\n    address: Address\n\n# Convert the Pydantic model to a PyArrow Schema\narrow_schema = get_pyarrow_schema(Person)\n\nprint(arrow_schema)\n# Expected output (order of fields may vary slightly depending on Pydantic version):\n# name: string\n# age: int64\n# height_cm: double\n# is_active: bool\n# created_at: timestamp[ns]\n# uuid_id: fixed_size_binary[16]\n# tags: list<item: string>\n#   child 0, item: string\n# address: struct<street: string, zip_code: int64>\n#   child 0, street: string\n#   child 1, zip_code: int64","lang":"python","description":"This quickstart defines a nested Pydantic model (`Person` containing `Address`) with various field types including optional fields, lists, datetime, and UUID. It then uses `get_pyarrow_schema` to generate the corresponding PyArrow schema, demonstrating the library's primary functionality. The output shows how Pydantic types map to PyArrow types.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-18","installed_version":"0.1.6","pypi_latest":"0.1.6","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":5.7,"avg_import_s":0.54,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"pydantic-to-pyarrow","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.35,"mem_mb":10.6,"disk_size":"202.8M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"pydantic-to-pyarrow","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5.6,"import_time_s":0.25,"mem_mb":10.6,"disk_size":"178M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pydantic-to-pyarrow","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.58,"mem_mb":11.8,"disk_size":"207.6M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"pydantic-to-pyarrow","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":4.7,"import_time_s":0.5,"mem_mb":11.8,"disk_size":"183M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"pydantic-to-pyarrow","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.98,"mem_mb":16.9,"disk_size":"272.8M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"pydantic-to-pyarrow","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":6.1,"import_time_s":0.95,"mem_mb":16.9,"disk_size":"243M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"pydantic-to-pyarrow","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.56,"mem_mb":14.1,"disk_size":"272.4M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"pydantic-to-pyarrow","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":6.2,"import_time_s":0.62,"mem_mb":14.1,"disk_size":"243M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"pydantic-to-pyarrow","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.34,"mem_mb":10.3,"disk_size":"183.5M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"pydantic-to-pyarrow","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":6,"import_time_s":0.3,"mem_mb":10.3,"disk_size":"166M"}]}}