Skip to main content

A Python library for integrating with various workflow providers

Project description

UniWorkflow

English Version | 中文版

UniWorkflow is a Python library that provides a unified interface for integrating with various workflow providers such as Make.com and Dify.

Installation

You can install UniWorkflow using pip:

pip install uniworkflow

Quick Start

Run a make.com workflow

Here's a simple example of how to use UniWorkflow:

# import the library
from uniworkflow import UniwWorkflow

# prepare the kwargs
kwargs = {
    "workflow_url": "https://example.make.com/your-workflow-hook",
    "method": "GET",
    "api_key": "your_api_key_here",
    "data": {"key1": "value1", "key2": "value2", ......},
}

# Execute a workflow
result = UniwWorkflow.execute("make", **kwargs)

# print the result
print(result)

Run a dify workflow

# import the library
from uniworkflow import UniwWorkflow

# prepare the kwargs
kwargs = {
    "workflow_url": "https://api.dify.ai/v1/workflows/run",
    "method": "POST",
    "api_key": "your_api_key_here",
    "data": {"key1": "value1", "key2": "value2", ......},
}

# Execute a workflow
result = UniwWorkflow.execute("dify", **kwargs) 

# print the result
print(result)

Parameters

  • workflow_url: The URL of the workflow to execute.
  • method: The HTTP method to use (GET, POST, etc.).
  • api_key: The API key to use for the workflow.
  • data: The data to pass to the workflow.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Running Tests

To run the tests for UniWorkflow, you can use pytest. Make sure you have pytest installed and replace the parameters in the test cases with your own.

pip install pytest

Then, run the tests:

pytest -s tests/test_make.py
pytest -s tests/test_dify.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

uniworkflow-0.1.3.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

uniworkflow-0.1.3-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file uniworkflow-0.1.3.tar.gz.

File metadata

  • Download URL: uniworkflow-0.1.3.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for uniworkflow-0.1.3.tar.gz
Algorithm Hash digest
SHA256 f7c9a08d2db973aca059f8b68c64f13b26e4431c4971390439642c8865682b59
MD5 8d4f66fefa9c6eaca6125add5fa6f705
BLAKE2b-256 299e0e0c2c3bffcaa162b3ce1e741fae3208e2de49c9dd5d5be619b0540afb16

See more details on using hashes here.

File details

Details for the file uniworkflow-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: uniworkflow-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for uniworkflow-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0b58f29e3777c34d304485e95faee222fd391e5c27b9130a8eebe6df87a2e25c
MD5 eca166f968b72a9671cbdfdd0ec3a842
BLAKE2b-256 dfca707470ef7d6bcda8a43b07ba9f9712cf9c31260bd29f639fe62d9726cbf2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page