Fast python conversion from protobuf to arrow using rust
Project description
ptars
Protobuf to Arrow, using Rust
Example
Take a protobuf:
message SearchRequest {
string query = 1;
int32 page_number = 2;
int32 result_per_page = 3;
}
And convert serialized messages directly to pyarrow.RecordBatch
:
messages = [
SearchRequest(
query="protobuf to arrow",
page_number=0,
result_per_page=10,
),
SearchRequest(
query="protobuf to arrow",
page_number=1,
result_per_page=10,
),
]
payloads = [message.SerializeToString() for message in messages]
pool = HandlerPool()
handler = pool.get_for_message(SearchRequest.DESCRIPTOR)
record_batch = handler.list_to_record_batch(payloads)
query | page_number | result_per_page |
---|---|---|
protobuf to arrow | 0 | 10 |
protobuf to arrow | 1 | 10 |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ptars-0.0.1.tar.gz
(78.4 kB
view hashes)
Built Distributions
Close
Hashes for ptars-0.0.1-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b78aa9acb82e62d3ae43d498c4f903972cbfdbbb6875f40a2932adc4a94e2a90 |
|
MD5 | d9e699c8645be205a10eed13e32c4c0e |
|
BLAKE2b-256 | 33ad9653cccc7a9478824c1bb11360521d7498467290dce67a42da5702880b01 |
Close
Hashes for ptars-0.0.1-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fda88479278fba133765f644d4a64f1585efdf4d8b46fc39daa334154ff7d55 |
|
MD5 | dcbd2b71ea4360c25660733dbae8dab7 |
|
BLAKE2b-256 | 533388715860509ae6a15c52ebcaaa39065eff9af176381b8b5f85bce7e55b87 |
Close
Hashes for ptars-0.0.1-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 507a7fec73f5ebc9e8238fec03bb412e2b7691fc5c959582ce30dd06541ec96b |
|
MD5 | 9cbc12e1afd017d4d2559b36dbcdb8fd |
|
BLAKE2b-256 | 2dad06e29cfb3750fd9515cc0ea26cf19e47a1d54b1c4e3e01441c53b8031798 |
Close
Hashes for ptars-0.0.1-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecd78335cd6bb983b8350959f028019d3f633ade1431dda1dae33803bea42ac8 |
|
MD5 | 7e9cd29bee427468be8bfd97c2f7a1bb |
|
BLAKE2b-256 | 1d0a7c04c565c77ce811ee2d22c54ab53669f263430e6d355e3e542c630768d4 |