Skip to main content

Python client SDK for Calimero Network

Project description

Calimero Network Python Client SDK

The Calimero Python Client SDK helps developers interact with decentralized apps by handling server communication. It simplifies the process, letting you focus on building your app while the SDK manages the technical details.

Features

  • JSON-RPC client for sending queries and updates to Calimero nodes
  • WebSocket client for real-time subscriptions
  • Authentication handling with Ed25519 keypairs
  • Configuration management
  • Type hints and comprehensive documentation

Installation

pip install calimero-client-py

Quick Start

Using JsonRpcClient

from calimero import JsonRpcClient

client = JsonRpcClient(
    base_url="http://localhost:2428",
    endpoint="/jsonrpc"
)

params = {
    "applicationId": "your_application_id",
    "method": "create_post",
    "argsJson": {"title": "My First Post", "text": "This is my first post"}
}

response = await client.mutate(params)
print(response)

Using WsSubscriptionsClient

from calimero import WsSubscriptionsClient

client = WsSubscriptionsClient(
    base_url="http://localhost:2428",
    endpoint="/ws"
)

await client.connect()
client.subscribe(["your_application_id"])

def callback(data):
    print(data)

client.add_callback(callback)

Documentation

For detailed documentation, please visit our documentation site.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Test Dependencies and Commands

To run tests, you need to install the test dependencies and then run the tests.

# Install test dependencies
pip install -e ".[test]"

# Run tests
pytest

# Run tests with coverage
pytest --cov=calimero

# Run specific test file
pytest tests/test_keypair.py

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

calimero_client_py-0.1.2.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

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

calimero_client_py-0.1.2-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file calimero_client_py-0.1.2.tar.gz.

File metadata

  • Download URL: calimero_client_py-0.1.2.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for calimero_client_py-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3b2534ff0e6bbd182f89030205562311567886588a7dc656c6b84e53a53c3b1d
MD5 3793d4fc629bebb95f336358ed87feeb
BLAKE2b-256 86bedf7bb8e6cc3f31e3d597bdeb617727cd7b690d82214ba835f595348db652

See more details on using hashes here.

File details

Details for the file calimero_client_py-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for calimero_client_py-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 47180f8aa980c9362e2620b6a15f2a7d79af8ac828782437685f3e3da232b9f2
MD5 d6b19ede034b749dfdaa3cb76eb1c533
BLAKE2b-256 874567f17ac00f927b73010388d74b6e182bd7c85163d28acbb5988d5f7857ea

See more details on using hashes here.

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