A client library for interacting with the BotRun API
Project description
botrun-hatch-client
A client library for interacting with the BotRun Flow Language (botrun_flow_lang) API. This library provides a simple and intuitive interface for applications to communicate with the BotRun Flow Language service using aiohttp for asynchronous requests.
About
botrun-hatch-client is designed to be a lightweight and easy-to-use async client for the BotRun Flow Language. It abstracts away the complexity of API communication, providing a simple interface for other applications to leverage BotRun's capabilities asynchronously.
Current Integrations
This client is currently integrated with:
- botrun_back: Backend service utilizing the client for core functionality
- botrun_ask_folder: Tool that uses the client to analyze folder structures
Installation
pip install botrun-hatch-client
Basic Usage
import asyncio
from botrun_hatch_client.client import HatchClient
async def main():
# Initialize with your API key
client = HatchClient(api_key="your_api_key")
try:
# Validate your connection
status = await client.validate_connection()
print(status)
# Make an API request
response = await client.make_request(
endpoint="some/endpoint",
method="POST",
data={"key": "value"}
)
print(response)
# Format a payload for the API
payload = {
"data": {
"key": "value",
"nested": {
"subkey": "subvalue"
}
}
}
formatted = client.format_payload(payload)
print(formatted)
finally:
# Always close the client session when done
await client.close()
# Run the async function
asyncio.run(main())
Development
Prerequisites
- Python 3.11+
- Poetry for dependency management
Setup
# Clone the repository
git clone <repository-url>
cd botrun-hatch-client
# Install dependencies
poetry install
Running Tests
# Run tests using the unittest framework
./run_tests.py
License
This project is licensed under the MIT License - see the LICENSE file for details.
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 botrun_hatch_client-5.3.131.tar.gz.
File metadata
- Download URL: botrun_hatch_client-5.3.131.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41dffdac1ef69817f9dcfc3a1a31ca9d273ed4006da9080b49ae1cadcc82fe41
|
|
| MD5 |
db126d7fb5e7ebee819a5b83997204f7
|
|
| BLAKE2b-256 |
22022481914fd7e2902cab3b583717dd2ff6bc8992fa7fb64c61836c3306d1c3
|
File details
Details for the file botrun_hatch_client-5.3.131-py3-none-any.whl.
File metadata
- Download URL: botrun_hatch_client-5.3.131-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ef643daee51adfff2482e10a8c685efab642c29b18d5762e90303e10cb9947b
|
|
| MD5 |
e52196884206966c1708e8ad9b1914a1
|
|
| BLAKE2b-256 |
2fb9f4588d42c8b54df055990eb1d34569a677dd34607a93a77fc1e0fbb7d519
|