Skip to main content

No project description provided

Project description

Botflow

Botflow is a lightweight Python framework for building automation workflows and bots with a focus on simplicity, modularity, and ease of integration.

Features

  • Workflow Management: Define complex bot workflows with simple, declarative syntax
  • Multi-language Support: Built-in i18n support with locale management
  • Resource Management: Centralized handling of styles, assets, and locales
  • Bundle Support: PyInstaller integration for creating standalone executables
  • Qt Integration: PySide6 support for GUI-based automation
  • Configuration: Flexible runtime configuration with environment variables

Quick Start

  1. Install Botflow via pip:

    pip install botflow-gui
    
  2. Create a simple bot workflow:

    from botflow import FlowManager, FlowSpec, TextStepSpec, run_application, run_flow_manager
    
    async def greet_user(ctx):
        name = ctx.data.get('greet_step')
        ctx.logger.info(f'Hello, {name}!')
    
    
    flow = FlowSpec(
        name='simple_flow',
        steps=[
            TextStepSpec(
                key='greet_step',
                title='Greet User',
                placeholder='Enter your name',
            ),
        ],
        on_finish=[greet_user]
    )
    
    
    if __name__ == '__main__':
        run_application()
        flow_manager = FlowManager(flow)
        run_flow_manager(flow_manager, window_title='Simple Flow Manager')
    
  3. (Optional) If you want to customize the resources directory or language, set the following environment variables in your script before importing Botflow:

    import os
    
    os.environ['BOTFLOW_RESOURCES_DIR'] = './custom_resources'
    os.environ['BOTFLOW_LANG'] = 'en_US'
    
    • When you use your own resources directory, Botflow will look for styles, locales, and other assets in the specified path and after that in the default package resources. So you can replace the default resources by providing your own.

      from botflow.resolver import find_resource_file
      
      resource_path = find_resource_file('styles/flow_manager.qss')
      
  4. Run your bot:

    python your_bot_script.py
    

How to create a bundle

To create a standalone executable bundle of your Botflow application, you can use PyInstaller. Follow these steps:

  1. Install PyInstaller:

    pip install pyinstaller
    
  2. Create a spec file for your application. You can generate a default spec file using:

    pyinstaller your_bot_script.py
    
  3. If you are using your own resources (like styles, locales, etc.), make sure to include them in the spec file. You can modify the datas section of the spec file to include your resources directory:

    pyinstaller your_bot_script.py --add-data "path/to/your/resources:resources"
    
  4. If you want to specify a custom resources directory for your bundle, you can set the BUNDLE_RESOURCES_DIR variable in your main script (If you don't set it, it defaults to 'BOTFLOW_RESOURCES_DIR' path if set):

    os.environ['BOTFLOW_BUNDLE_RESOURCES_DIR'] = './custom_resources'
    

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

botflow_gui-0.0.3.tar.gz (65.7 kB view details)

Uploaded Source

Built Distribution

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

botflow_gui-0.0.3-py3-none-any.whl (78.8 kB view details)

Uploaded Python 3

File details

Details for the file botflow_gui-0.0.3.tar.gz.

File metadata

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

File hashes

Hashes for botflow_gui-0.0.3.tar.gz
Algorithm Hash digest
SHA256 7a3e931f6727c9986d5b8255b78db7740c9640526ec99e2ecb6b3341626d0161
MD5 0b1ec038ec1b15251e519bec8d46751b
BLAKE2b-256 a15df5b63d1d9727e1da05313905e2c7bf1bc8dd985f9d55675b79e2528942ac

See more details on using hashes here.

File details

Details for the file botflow_gui-0.0.3-py3-none-any.whl.

File metadata

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

File hashes

Hashes for botflow_gui-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a58f1b8fa3e35d7a4d761e4a70b2cfdc20389d485d4cd76805bd9057d875c639
MD5 19727c64662141436f2e702bb76b16a7
BLAKE2b-256 316a75e977aae67a7d2c17e9d5735b10b60fb9830fce17c02a27eb43db417627

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