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.5.211.tar.gz (4.6 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.5.211-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file botrun_hatch_client-5.5.211.tar.gz.

File metadata

  • Download URL: botrun_hatch_client-5.5.211.tar.gz
  • Upload date:
  • Size: 4.6 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.5.211.tar.gz
Algorithm Hash digest
SHA256 86f2ff747d9ccb7ff74b0116d133fb872d7ff862ab24173cf5936b9de84ecd3f
MD5 82589f159b84cf6cfa4aea9f0583320b
BLAKE2b-256 9e2c45a2f5f69355d770605a985d05f0a9e8b83a52905ee18acb74d5f3b3875a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for botrun_hatch_client-5.5.211-py3-none-any.whl
Algorithm Hash digest
SHA256 c9ffeb99c37e8a29a3a9f5d8c5656c8eb9971be1114a456af5c835f16bc1918c
MD5 387725026a63cd2f99149624c4c1faed
BLAKE2b-256 6cebc664224a636bf72b3aec9c2e45a492cf7619f5804af4bd8650dbab7894df

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