EtherHound API - API Client for EtherHound Core
Project description
Table of Contents
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
Built With
Getting Started
Prerequisites
- python >= 3.11
- pydantic
- aiohttp
Installation
Github installation:
- clone the repo
git clone https://github.com/EtherHounds/API.git
- cd into the repo
cd API
- build
pip install . -U
- done!
PyPi (recommended):
pip install etherhound-api
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())
Roadmap
- Examples
- Better Documentation
See the open issues for a full list of proposed features (and known issues).
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!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Top contributors:
License
Distributed under the project_license. See LICENSE.txt for more information.
Contact
SpicyPenguin - @kerolis55463
Project Link: https://github.com/EtherHounds/API
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85581cb4efaa449a18b64940e0f942f611ec3c2b11e01f2e08e7393c4e658665
|
|
| MD5 |
e22afccc8dd63ba1e262804a2bcfec41
|
|
| BLAKE2b-256 |
cde5e5907ace56eed75b7fe598b21825a0a5cbe886441cc35b11c8cdf0d88b99
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5ef8f5a57c4e23cd9c49b94ba3ed79b8c911a2b2b0c220b36cf676e562c9ebc
|
|
| MD5 |
e0efcbae4ba5ab6533914c2ec9fbba5c
|
|
| BLAKE2b-256 |
5450313037020a02f2e36ee8f599525b99eaf39c307efec80272a8473ed554b7
|