pyCelestia
This module provides a Python interface for interacting with the Celestia Node API. All methods communicate with the API via JSON-RPC, offering a flexible and developer-friendly solution for integrating Celestia functionality into applications.
It is designed for developers who want to interact with the Celestia network without dealing with the complexities of low-level RPC request handling.
🚀 Installation
pip install pycelestia
🔧 Usage
Connecting to Celestia Node
Below is an example of how to connect to a real Celestia node using its RPC endpoint.
from pycelestia import Client
# Configuration for connecting to a Celestia node
node_url = "https://celestia-rpc.example.com" # Replace with the actual RPC node URL
auth_token = "your-auth-token" # Replace with your authentication token (if required)
# Initialize the client
client = Client(base_url=node_url)
# Example usage of the API
async with client.connect(auth_token) as api:
balance = await api.state.balance()
Custom Deserialization Example
from pydantic import BaseModel
class CustomBalanceModel(BaseModel):
amount: int
denom: str
async with client.connect(auth_token) as api:
# The `deserializer` parameter allows you to transform raw API data into a desired format
last_height = await api.header.local_head(deserializer=lambda data: int(data['header']['height']))
isinstance(last_height, int) # True
# Use the Pydantic model to validate and transform the balance response
balance = await api.state.balance(deserializer=CustomBalanceModel.model_validate)
isinstance(balance.amount, int) # True
Metadata
Release files for pyCelestia 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pycelestia-0.1.7.tar.gz | 58.9 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| pycelestia-0.1.7-cp313-cp313-manylinux_2_28_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.28+ x86-64 | Details |
| pycelestia-0.1.7-cp312-cp312-manylinux_2_28_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.28+ x86-64 | Details |
| pycelestia-0.1.7-cp311-cp311-manylinux_2_28_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.28+ x86-64 | Details |
| pycelestia-0.1.7-cp310-cp310-manylinux_2_28_x86_64.whl | CPython 3.10 | CPython 3.10 | Linux glibc 2.28+ x86-64 | Details |
Total release size: 1.3 MB
Release files / pycelestia-0.1.7.tar.gz
| Download URL | pycelestia-0.1.7.tar.gz |
|---|---|
| Size | 58.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bc829b085bea8c64aaa5493cce488e1891266b15be69ff3c5c237578360cf401
|
|
BLAKE2b-256 checksum How to use checksums |
fdb19e132674916e99f9d4f1eb632e00870e65bcdb8c0dabd8e3c74f2d1efdc0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / pycelestia-0.1.7-cp313-cp313-manylinux_2_28_x86_64.whl
| Download URL | pycelestia-0.1.7-cp313-cp313-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 318.4 kB |
| Tags | CPython 3.13 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
2a5be4fb0b6c5730829afc9d929ca29818a7784057ffd4a01de9a5981f79262d
|
|
BLAKE2b-256 checksum How to use checksums |
9ac7357347373179265033d31b67d8409ff3d759f77490bf96fd3479c83ce8f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / pycelestia-0.1.7-cp312-cp312-manylinux_2_28_x86_64.whl
| Download URL | pycelestia-0.1.7-cp312-cp312-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 318.2 kB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
4483d18a4bc2b7610bceeab4d4d1528f89dae489cd9450e1ac6eaffa160e6442
|
|
BLAKE2b-256 checksum How to use checksums |
7a8207c0760e057f68170f879cae96a9d804a0be2f484f85128bda40f1b7a6f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / pycelestia-0.1.7-cp311-cp311-manylinux_2_28_x86_64.whl
| Download URL | pycelestia-0.1.7-cp311-cp311-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 318.9 kB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
6ec8821dd98b5fcc7af62c1cec0d3fa69cc72b6c8fce6f755a802e842b57d47d
|
|
BLAKE2b-256 checksum How to use checksums |
b288c1af2e82c6cf59e2cce23c1f76e2782062bcf85034d3ee11f65712fd8195
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / pycelestia-0.1.7-cp310-cp310-manylinux_2_28_x86_64.whl
| Download URL | pycelestia-0.1.7-cp310-cp310-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 319.0 kB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
b7e583e0b7f7bb518d77b3c96de1c31c6b2b745858b73e9122d1180bee95703d
|
|
BLAKE2b-256 checksum How to use checksums |
65468354df0f1bf135f294c9d54263242a8e71f68efc574b063a376b19d0d496
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|