Skip to main content

EtherHound API - API Client for EtherHound Core

Project description

Forks Issues Contributors


Logo

EtherHound (API)

The API of EtherHound Core
Explore the docs »

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

EtherHound API is an asynchronous Python client library designed to interact seamlessly with the EtherHound Core API. It provides a simple and efficient interface for making HTTP requests to EtherHound-powered services, supporting modern Python features and type hints. Built on top of aiohttp and leveraging pydantic for data validation, this library enables developers to quickly integrate EtherHound API endpoints into their applications with minimal boilerplate.

Key features:

  • Asynchronous HTTP requests for high performance
  • Configurable host, port, and protocol settings
  • Designed for extensibility

(back to top)

Built With

  • Pydantic

(back to top)

Getting Started

Prerequisites

  • python >= 3.11
  • pydantic
  • aiohttp

Installation

Github installation:

  1. clone the repo
git clone https://github.com/EtherHounds/API.git
  1. cd into the repo
cd API
  1. build
pip install . -U
  1. done!

PyPi (recommended):

pip install etherhound-api

(back to top)

Usage

Subscribe to an Event

from houndapi import HoundAPI, LogsSubscription
import asyncio

async def main():
  client = HoundAPI(
    host="127.0.0.1", # local host
    port=8080
  )
  result = await client.subscribe(LogsSubscription(
    label="deposits",
    address="0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", # BSC-WBNB Contract
    topics=["0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"] # The Deposit Event Hash
  ))
  print(f"Subscribed Successfully ✔️, Subscription ID: ({result.result[0]})")
  await client.close()

asyncio.run(main())

Poll Subscription Events

from houndapi import HoundAPI
import asyncio

async def main():
  client = HoundAPI(
    host="127.0.0.1", # local host
    port=8080
  )
  result = await client.poll(
    subscription_id="0xYourSubscriptionID",
    limit=10 # poll only first 10 events
  )
  for res in result:
    print(f"New Event From Subscription {res.label}")
    print(f"({res.result.address}) Has Deposited {(int(res.result.data, base=16))*10**-18:.8f} WBNB")
    print(f"(https://bscscan.com/tx/{res.result.transaction_hash})")
    print("-"*50)
  await client.close()

asyncio.run(main())

(back to top)

Roadmap

  • Examples
  • Better Documentation

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

Top contributors:

contrib.rocks image

License

Distributed under the project_license. See LICENSE.txt for more information.

(back to top)

Contact

SpicyPenguin - @kerolis55463

Project Link: https://github.com/EtherHounds/API

(back to top)

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

etherhound_api-1.0.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

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

etherhound_api-1.0.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file etherhound_api-1.0.0.tar.gz.

File metadata

  • Download URL: etherhound_api-1.0.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for etherhound_api-1.0.0.tar.gz
Algorithm Hash digest
SHA256 85581cb4efaa449a18b64940e0f942f611ec3c2b11e01f2e08e7393c4e658665
MD5 e22afccc8dd63ba1e262804a2bcfec41
BLAKE2b-256 cde5e5907ace56eed75b7fe598b21825a0a5cbe886441cc35b11c8cdf0d88b99

See more details on using hashes here.

File details

Details for the file etherhound_api-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: etherhound_api-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for etherhound_api-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b5ef8f5a57c4e23cd9c49b94ba3ed79b8c911a2b2b0c220b36cf676e562c9ebc
MD5 e0efcbae4ba5ab6533914c2ec9fbba5c
BLAKE2b-256 5450313037020a02f2e36ee8f599525b99eaf39c307efec80272a8473ed554b7

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