A Python library for integrating with various workflow providers
Project description
UniWorkflow
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
Built Distribution
File details
Details for the file uniworkflow-0.1.4.tar.gz
.
File metadata
- Download URL: uniworkflow-0.1.4.tar.gz
- Upload date:
- Size: 18.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9df261305125e93f3f9a115bd5310e95cdf8f5cc0392368033b3e8a5854b4398 |
|
MD5 | b3f4da0b8e5acb1fd4fbee436c8ead0a |
|
BLAKE2b-256 | 64957ff0d30a83f7148438d27194276a26c7667f0d44f216564230cb3cce186d |
File details
Details for the file uniworkflow-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: uniworkflow-0.1.4-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 575df7659767d984393cd308d6004f04ca9c9761c58627f5267591f172a1cc25 |
|
MD5 | 4432959f42651b74cda002c7fdf994cb |
|
BLAKE2b-256 | ffd188056f36f94a32dd3a73abfbf9fed55b047caca45ae0234d06d605a7ff14 |