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.1.tar.gz (11.9 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.1-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: calimero_client_py-0.1.1.tar.gz
  • Upload date:
  • Size: 11.9 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.1.tar.gz
Algorithm Hash digest
SHA256 3835c4b5e6e0678fef50213b8ced0de047693831c5a891197605f99cb9b350ea
MD5 b4949e2dd4ff2db51dc1feef9f45f159
BLAKE2b-256 066652094e7a39dc1c1ca7880523e6dc0f0360dacb43b716bd6d5983b8c3445f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for calimero_client_py-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 834318e661f4b7155fe323cc05cbfe357b0007f3f2593dcde0f1cccf2dda1bf9
MD5 3c3d3fd1824bb421724a95b0c9791fe4
BLAKE2b-256 b094244a88178c8f46f60882c434409d884894d8544e8ee609840f0239427130

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