# UniWorkflow
[English Version](README.md) | [中文版](README_zh.md)
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:
```python
# 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
```python
# 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](LICENSE) file for details.
Raw data
{
"_id": null,
"home_page": "https://github.com/yourusername/uniworkflow",
"name": "uniworkflow",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Your Name",
"author_email": "your.email@example.com",
"download_url": "https://files.pythonhosted.org/packages/7c/93/658a405d73273dc87915bcd6f05928da533b638d4891fddb622e25574abc/uniworkflow-0.1.1.tar.gz",
"platform": null,
"description": "# UniWorkflow\n\n[English Version](README.md) | [\u4e2d\u6587\u7248](README_zh.md)\n\n\nUniWorkflow is a Python library that provides a unified interface for integrating with various workflow providers such as Make.com and Dify.\n\n## Installation\n\nYou can install UniWorkflow using pip:\n\n```\npip install uniworkflow\n```\n\n## Quick Start\n\n### Run a make.com workflow\nHere's a simple example of how to use UniWorkflow:\n\n```python\n# import the library\nfrom uniworkflow import UniwWorkflow\n\n# prepare the kwargs\nkwargs = {\n \"workflow_url\": \"https://example.make.com/your-workflow-hook\",\n \"method\": \"GET\",\n \"api_key\": \"your_api_key_here\",\n \"data\": {\"key1\": \"value1\", \"key2\": \"value2\", ......},\n}\n\n# Execute a workflow\nresult = UniwWorkflow.execute(\"make\", **kwargs)\n\n# print the result\nprint(result)\n```\n\n### Run a dify workflow\n\n```python\n# import the library\nfrom uniworkflow import UniwWorkflow\n\n# prepare the kwargs\nkwargs = {\n \"workflow_url\": \"https://api.dify.ai/v1/workflows/run\",\n \"method\": \"POST\",\n \"api_key\": \"your_api_key_here\",\n \"data\": {\"key1\": \"value1\", \"key2\": \"value2\", ......},\n}\n\n# Execute a workflow\nresult = UniwWorkflow.execute(\"dify\", **kwargs) \n\n# print the result\nprint(result)\n```\n\n## Parameters\n\n- `workflow_url`: The URL of the workflow to execute.\n- `method`: The HTTP method to use (GET, POST, etc.).\n- `api_key`: The API key to use for the workflow.\n- `data`: The data to pass to the workflow.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## Running Tests\n\nTo 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.\n\n```\npip install pytest\n```\n\nThen, run the tests:\n\n```\npytest -s tests/test_make.py\npytest -s tests/test_dify.py\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python library for integrating with various workflow providers",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://github.com/yourusername/uniworkflow"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "64a2f570e2397b32ecaaf2d2e28b66eb08a4e6b07b63558ead6b37045ca23db0",
"md5": "74cb06f48ebb475e1d9441f7db8ca8d0",
"sha256": "ced7e00bb12912e3a437967d2ca90375906293a1c25160a97d6da208d837d6be"
},
"downloads": -1,
"filename": "uniworkflow-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "74cb06f48ebb475e1d9441f7db8ca8d0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 7942,
"upload_time": "2024-09-14T11:01:57",
"upload_time_iso_8601": "2024-09-14T11:01:57.615425Z",
"url": "https://files.pythonhosted.org/packages/64/a2/f570e2397b32ecaaf2d2e28b66eb08a4e6b07b63558ead6b37045ca23db0/uniworkflow-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7c93658a405d73273dc87915bcd6f05928da533b638d4891fddb622e25574abc",
"md5": "0aba8c4f1c134f7bf51391779645ff29",
"sha256": "1d55a3a700385c4d8f910db5dfbc83dfa5e691263c7baf28c0bcc2b02bd2d751"
},
"downloads": -1,
"filename": "uniworkflow-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "0aba8c4f1c134f7bf51391779645ff29",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 13251,
"upload_time": "2024-09-14T11:01:59",
"upload_time_iso_8601": "2024-09-14T11:01:59.334560Z",
"url": "https://files.pythonhosted.org/packages/7c/93/658a405d73273dc87915bcd6f05928da533b638d4891fddb622e25574abc/uniworkflow-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-14 11:01:59",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yourusername",
"github_project": "uniworkflow",
"github_not_found": true,
"lcname": "uniworkflow"
}