Metadata-Version: 2.4
Name: bitquery-pb2-kafka-package
Version: 0.2.21
Summary: This package contains the pb2 files necessary to interact with Bitquery Kafka Protobuf messages
Author-email: Bitquery <divyasshree@bitquery.io>
License: MIT License
        
        Copyright (c) 2025 Bitquery
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in
        all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
        THE SOFTWARE.
        
Project-URL: Homepage, https://github.com/bitquery/streaming_protobuf/tree/main
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Bitquery Protobuf Kafka Package

A Python library containing `pb2` files to simplify parsing blockchain data (Solana, EVM & Tron) from Bitquery Kafka Streams using Protobuf messages.

Read more on Bitquery onchain data streams [here](https://docs.bitquery.io/docs/streams/kafka-streaming-concepts/)

## Installation

Install easily via pip:

```bash
pip install bitquery-pb2-kafka-package

```

## Usage

You can import and use the protobuf-generated Python classes like this:

### ▶️ Price Index

Read about the new price index stream [here](https://docs.bitquery.io/docs/trading/price-index/introduction/)

```
from price_index import price_index_pb2

price_feed=price_index_pb2.PriceIndexMessage()
```

### ▶️ Solana

```python
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

```python
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

```python
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)

```

## Available Protobuf Messages

### Solana

- `block_message_pb2.BlockMessage`
- `dex_block_message_pb2.DexBlockMessage`
- `ohlc_message_pb2.OhlcMessage`
- `parsed_idl_block_message_pb2.ParsedIdlBlockMessage`
- `token_block_message_pb2.TokenBlockMessage`

### EVM

- `block_message_pb2.BlockMessage`
- `dex_block_message_pb2.DexBlockMessage`
- `parsed_abi_block_message_pb2.ParsedAbiBlockMessage`
- `token_block_message_pb2.TokenBlockMessage`
- `dex_pool_block_message_pb2.DexPoolBlockMessage`

### Tron

- `block_message_pb2.BlockMessage`
- `dex_block_message_pb2.DexBlockMessage`
- `parsed_abi_block_message_pb2.ParsedAbiBlockMessage`
- `token_block_message_pb2.TokenBlockMessage`
