Skip to main content

Ogmios is a lightweight bridge interface for cardano-node. It offers a WebSockets API that enables local clients to speak Ouroboros' mini-protocols via JSON/RPC. ogmios-python is an Ogmios client written in Python designed for ease of use.

Project description

ogmios-python

Pipeline Documentation Status PyPI - Version PyPI - Python Version


Ogmios is a lightweight bridge interface for cardano-node. It offers a WebSockets API that enables local clients to speak Ouroboros’ mini-protocols via JSON/RPC. ogmios-python is an Ogmios client written in Python designed for ease of use.


Table of Contents

Installation

  1. Install cardano-node and Ogmios server as described here. (Docker installation is recommended.)
  2. Install ogmios-python from PyPI using pip:
pip install ogmios

Quickstart

To see how easy it is to build on Cardano with ogmios-python, let's use the library to view new blocks as they are added to the blockchain:

import time
import ogmios

with ogmios.Client() as client:
    # Set chain pointer to origin
    _, tip, _ = client.find_intersection.execute([ogmios.Origin()])

    # Now set chain pointer to tip
    _, _, _ = client.find_intersection.execute([tip.to_point()])

    # Tail blockchain as new blocks come in beyond the current tip
    while True:
        client.next_block.execute()
        time.sleep(1)

terminal output

For more examples, see the documentation and example scripts in the repo.

Documentation

Complete client documentation is available on Read the Docs.

License

ogmios-python is distributed under the terms of the GPL-3.0-or-later license.

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

ogmios-0.2.0.tar.gz (92.4 kB view details)

Uploaded Source

Built Distribution

ogmios-0.2.0-py3-none-any.whl (103.9 kB view details)

Uploaded Python 3

File details

Details for the file ogmios-0.2.0.tar.gz.

File metadata

  • Download URL: ogmios-0.2.0.tar.gz
  • Upload date:
  • Size: 92.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.25.0

File hashes

Hashes for ogmios-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d491d8ead097b745394396fbb152657a458e3c6e8166d5d296182bd7fa7fb546
MD5 ad6ba589c7429e199e8b90c99483c9ee
BLAKE2b-256 d90108b31254f65bfe3fcd7d6d888be2bda0393e6d8eecc96f36d725bc5e1088

See more details on using hashes here.

File details

Details for the file ogmios-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ogmios-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 103.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.25.0

File hashes

Hashes for ogmios-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6ca1690fa4bd314429f7ddcc1a2949044d0f23796065ff98f7f631aec36e531
MD5 3b8f3e285ea6b41719d78d0e4f5bdc40
BLAKE2b-256 6a92a29015a4b540359d90328e0af20b460c9ea3e1182f35db20732be9bc372c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page