Skip to main content

Convert from protobuf to arrow and back

Project description

Protarrow

PyPI Version Conda Version Python Version Github Stars codecov Build Status Documentation License Downloads Downloads Conda Downloads Code style: black snyk GitHub issues Contributing Repo Size FOSSA Status Python

Protarrow is a python library for converting from Protocol Buffers to Apache Arrow and back.

It is used at Tradewell Technologies, to share data between transactional and analytical applications, with little boilerplate code and zero data loss.

Installation

pip install protarrow

Usage

Taking a simple protobuf:

message MyProto {
  string name = 1;
  int32 id = 2;
  repeated int32 values = 3;
}

It can be converted to a pyarrow.Table:

import protarrow

my_protos = [
    MyProto(name="foo", id=1, values=[1, 2, 4]),
    MyProto(name="bar", id=2, values=[3, 4, 5]),
]

table = protarrow.messages_to_table(my_protos, MyProto)
name id values
foo 1 [1 2 4]
bar 2 [3 4 5]

And the table can be converted back to proto:

protos_from_table = protarrow.table_to_messages(table, MyProto)

See the documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

protarrow-0.16.0.tar.gz (4.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

protarrow-0.16.0-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file protarrow-0.16.0.tar.gz.

File metadata

  • Download URL: protarrow-0.16.0.tar.gz
  • Upload date:
  • Size: 4.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for protarrow-0.16.0.tar.gz
Algorithm Hash digest
SHA256 2d49ea390018f8c06f2f57cd45c0691658ba08930976d8f63a27cd85e1d187d6
MD5 bf592f162c450c074b8f32ecfaf763ee
BLAKE2b-256 69b6cee6a10990ffd82d801bd329ae398078e9649eb93d5eff8f5b834c0c9acc

See more details on using hashes here.

Provenance

The following attestation bundles were made for protarrow-0.16.0.tar.gz:

Publisher: publish.yaml on tradewelltech/protarrow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file protarrow-0.16.0-py3-none-any.whl.

File metadata

  • Download URL: protarrow-0.16.0-py3-none-any.whl
  • Upload date:
  • Size: 21.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for protarrow-0.16.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b620a25fee9c939b388dfc9ee446d01b2c711f5be0c7a59a26c7ae74c8a9714
MD5 101dcc23b7c103cff8ff858f4341fa06
BLAKE2b-256 cdc30a4fb1be64d4b36cb7784c9d8daf856ea1851d6bcd562f2194e77f6513fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for protarrow-0.16.0-py3-none-any.whl:

Publisher: publish.yaml on tradewelltech/protarrow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page