Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

botrun_hatch_client-5.3.131.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

botrun_hatch_client-5.3.131-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

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

Hashes for botrun_hatch_client-5.3.131.tar.gz
Algorithm Hash digest
SHA256 41dffdac1ef69817f9dcfc3a1a31ca9d273ed4006da9080b49ae1cadcc82fe41
MD5 db126d7fb5e7ebee819a5b83997204f7
BLAKE2b-256 22022481914fd7e2902cab3b583717dd2ff6bc8992fa7fb64c61836c3306d1c3

See more details on using hashes here.

File details

Details for the file botrun_hatch_client-5.3.131-py3-none-any.whl.

File metadata

File hashes

Hashes for botrun_hatch_client-5.3.131-py3-none-any.whl
Algorithm Hash digest
SHA256 9ef643daee51adfff2482e10a8c685efab642c29b18d5762e90303e10cb9947b
MD5 e52196884206966c1708e8ad9b1914a1
BLAKE2b-256 2fb9f4588d42c8b54df055990eb1d34569a677dd34607a93a77fc1e0fbb7d519

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