Skip to content

Instantly share code, notes, and snippets.

@gatesn
gatesn / aiopa.py
Last active May 11, 2025 16:13
PyArrow and Async IO
from typing import AsyncIterator
import pyarrow as pa
class AsyncMessageReader(AsyncIterator[pa.Message]):
"""Wraps an async iterable of bytes into an async iterable of PyArrow IPC messages.
From this it is possible to build an AsyncRecordBatchStreamReader.
"""
@gatesn
gatesn / build.py
Created August 11, 2023 16:03
Ziggy Pydust - Python, Poetry and Zig
from setuptools_zig import ZigExtension, zig_build_ext
def build(setup_kwargs):
setup_kwargs["ext_modules"] = [ZigExtension("mypackage._mymodule", build_zig="path/to/build.zig")]
setup_kwargs["cmdclass"] = {"build_ext": zig_build_ext}