Bitquery Protobuf Kafka Package
A Python library containing pb2 files to simplify parsing blockchain data (Solana, EVM, Tron, TON, UTXO, Hyperliquid) and market/trading data from Bitquery Kafka Streams using Protobuf messages.
Read more on Bitquery onchain data streams here
Installation
Install easily via pip:
pip install bitquery-pb2-kafka-package
Usage
You can import and use the protobuf-generated Python classes like this:
▶️ Price Index / Market
Read about the new price index stream here
from market import price_index_pb2, trades_pb2, marketdata_pb2
# Price index updates (currency, token, and pair price updates)
price_feed = price_index_pb2.PriceIndexMessage()
# Trades stream
trades_msg = trades_pb2.TradesMessage()
▶️ Solana
from solana import block_message_pb2
# Create a Solana BlockMessage instance
block_message = block_message_pb2.BlockMessage()
# Set fields
block_message.field_name = "value"
# Serialize to bytes
serialized = block_message.SerializeToString()
# Deserialize from bytes
msg = block_message_pb2.BlockMessage()
msg.ParseFromString(serialized)
print(msg)
▶️ EVM
from evm import block_message_pb2
# Create an EVM BlockMessage instance
evm_block = block_message_pb2.BlockMessage()
# Set fields
evm_block.field_name = "value"
# Serialize and Deserialize
data = evm_block.SerializeToString()
decoded = block_message_pb2.BlockMessage()
decoded.ParseFromString(data)
print(decoded)
▶️ Tron
from tron import block_message_pb2
# Create a Tron BlockMessage instance
tron_block = block_message_pb2.BlockMessage()
# Set fields
tron_block.field_name = "value"
# Serialize and Deserialize
data = tron_block.SerializeToString()
decoded = block_message_pb2.BlockMessage()
decoded.ParseFromString(data)
print(decoded)
▶️ Hyperliquid
from hyperliquid import hyperliquid_block_message_pb2
# One message per HyperCore block: trades, orders, funding, liquidations,
# TWAPs, book updates, oracle prices, leverage changes, and signed actions
msg = hyperliquid_block_message_pb2.HyperliquidCoreBlockMessage()
msg.ParseFromString(serialized)
for trade in msg.Trades:
print(trade)
Available Protobuf Messages
Price Index / Market
price_index_pb2.PriceIndexMessage— top-level message withCurrencyUpdates,TokenUpdates, andPairUpdatesprice_index_pb2.PairUpdate— pair-level price update with market, currency, token, and price dataprice_index_pb2.CurrencyUpdate— currency-level price updateprice_index_pb2.TokenUpdate— token-level price update with rankingtrades_pb2.TradesMessage— stream of trades with pair, amounts, price, trader, and transaction infotrades_pb2.Trade— individual trade withSide(Buy/Sell),Price,PriceInUsd, and amountsmarketdata_pb2.MarketdataMessage— currency price buckets from external sources (e.g. CryptoRank)
Solana
block_message_pb2.BlockMessagedex_block_message_pb2.DexBlockMessageohlc_message_pb2.OhlcMessageparsed_idl_block_message_pb2.ParsedIdlBlockMessagetoken_block_message_pb2.TokenBlockMessageperpetual_block_message_pb2.PerpetualBlockMessage— perpetual DEX activity (ParsedPerpetualTransaction,PerpetualAsset,PerpetualAmount)prediction_market_block_message_pb2.PredictionMarketBlockMessage— prediction market activity (ParsedPredictionTransaction,OutcomeTrade,OutcomeSettlement)solana.corecast— CoreCast gRPC stream definitions (corecast_pb2,request_pb2,stream_message_pb2)
EVM
block_message_pb2.BlockMessagedex_block_message_pb2.DexBlockMessageparsed_abi_block_message_pb2.ParsedAbiBlockMessagetoken_block_message_pb2.TokenBlockMessagedex_pool_block_message_pb2.DexPoolBlockMessageprediction_market_block_message_pb2.PredictionMarketBlockMessage
Tron
block_message_pb2.BlockMessagedex_block_message_pb2.DexBlockMessageparsed_abi_block_message_pb2.ParsedAbiBlockMessagetoken_block_message_pb2.TokenBlockMessage
TON
block_message_pb2.BlockMessagedex_block_message_pb2.DexBlockMessageevent_message_pb2.EventMessagetoken_block_message_pb2.TokenBlockMessagetrace_message_pb2— transaction trace messages
UTXO (Bitcoin-like chains)
block_message_pb2.BlockMessageparsed_block_message_pb2.ParsedBlockMessage
Hyperliquid (HyperCore)
hyperliquid_block_message_pb2.HyperliquidCoreBlockMessage— one message per HyperCore block, covering all market kinds (perp, HIP-3, spot, outcome) with fieldsTrades,Orders,Funding,Liquidations,Twaps,BookUpdates,Prices,LeverageChanges, andSignedActionsfills_pb2— trade fillsorder_statuses_pb2— order status updatestwap_statuses_pb2— TWAP order statusesraw_book_diffs_pb2— raw order book diffsoracle_updates_pb2— oracle price updatescore_writer_actions_pb2— core writer actionsmisc_events_pb2— funding, liquidations, and other misc eventstransactions_pb2— consensus-stream transactions (leverage changes, signed actions)hypercore_pb2,candles_pb2— supporting HyperCore types and candles
Offchain
entities_pb2— offchain entity definitions (addresses, chains, groups)
Metadata
Release files for bitquery-pb2-kafka-package 0.2.34
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| bitquery_pb2_kafka_package-0.2.34.tar.gz | 37.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bitquery_pb2_kafka_package-0.2.34-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 112.4 kB
Release files / bitquery_pb2_kafka_package-0.2.34.tar.gz
| Download URL | bitquery_pb2_kafka_package-0.2.34.tar.gz |
|---|---|
| Size | 37.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
461125e8ed579568a4679da96c19f10339d2696f18d97a768a51a34148ec5add
|
|
BLAKE2b-256 checksum How to use checksums |
389aca341d5e32a7cb675f7b7d836b36457d326a2b0f653a3aadcfbe4f5a1a1b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.20
|
Release files / bitquery_pb2_kafka_package-0.2.34-py3-none-any.whl
| Download URL | bitquery_pb2_kafka_package-0.2.34-py3-none-any.whl |
|---|---|
| Size | 75.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8c11bd3c0ee2db73a135ef3fb44d5b8e16409b3ec06febe5618609052623305c
|
|
BLAKE2b-256 checksum How to use checksums |
56497ca91cf67d0e4562e51a0f42eaa1e10a56f4bec0d8c1a6bd34242256a668
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.20
|
Security for bitquery-pb2-kafka-package 0.2.34
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.