@@ -528,3 +528,42 @@ def closed(self) -> bool:
528528SequenceT = TypeVar ("SequenceT" , bound = Sequence [Hashable ])
529529
530530SliceType = Optional [Hashable ]
531+
532+
533+ # Arrow PyCapsule Interface
534+ # from https://arrow.apache.org/docs/format/CDataInterface/PyCapsuleInterface.html#protocol-typehints
535+
536+
537+ class ArrowArrayExportable (Protocol ):
538+ """
539+ An object with an ``__arrow_c_array__`` method.
540+
541+ This method indicates the object is an Arrow-compatible object implementing
542+ the `Arrow PyCapsule Protocol`_ (exposing the `Arrow C Data Interface`_ in
543+ Python), enabling zero-copy Arrow data interchange across libraries.
544+
545+ .. _Arrow PyCapsule Protocol: https://arrow.apache.org/docs/format/CDataInterface/PyCapsuleInterface.html
546+ .. _Arrow C Data Interface: https://arrow.apache.org/docs/format/CDataInterface.html
547+
548+ """
549+
550+ def __arrow_c_array__ (
551+ self , requested_schema : object | None = None
552+ ) -> tuple [object , object ]: ...
553+
554+
555+ class ArrowStreamExportable (Protocol ):
556+ """
557+ An object with an ``__arrow_c_stream__`` method.
558+
559+ This method indicates the object is an Arrow-compatible object implementing
560+ the `Arrow PyCapsule Protocol`_ (exposing the `Arrow C Data Interface`_
561+ for streams in Python), enabling zero-copy Arrow data interchange across
562+ libraries.
563+
564+ .. _Arrow PyCapsule Protocol: https://arrow.apache.org/docs/format/CDataInterface/PyCapsuleInterface.html
565+ .. _Arrow C Data Interface: https://arrow.apache.org/docs/format/CDataInterface.html
566+
567+ """
568+
569+ def __arrow_c_stream__ (self , requested_schema : object | None = None ) -> object : ...
0 commit comments