Skip to main content

Zeebe client api

Project description

Coverage Status GitHub Workflow Status (branch) GitHub issues GitHub pull requests GitHub closed pull requests GitHub tag (latest by date) PyPI - Python Version PyPI

Pyzeebe

pyzeebe is a python grpc client for Zeebe.

Zeebe version support:

Pyzeebe version Tested Zeebe versions
1.0.1 0.24.2

Getting Started

To install:

pip install pyzeebe

Usage

Worker

from pyzeebe import ZeebeWorker, Task, TaskStatusController, TaskContext

def example_task(input: str):
    return {'output': f'Hello world, {input}!'}

def on_error(exception: Exception, context: TaskContext, task_status_controller: TaskStatusController):
    """
    on_error will be called when the task fails
    """ 
    print(exception)
    task_status_controller.error(f'Failed to handle task {context.type}. Error: {str(exception)}')

task = Task(type='example', task_handler=example_task, exception_handler=on_error) # Create task object from example_task

worker = ZeebeWorker(hostname='<zeebe_host>', port=26500) # Create a zeebe worker
worker.add_task(task) # Add task to zeebe worker

worker.work() # Now every time that a task with type example is called example_task will be called

Tests

Use the package manager pip to install pyzeebe

pytest .

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

We use the MIT license, see LICENSE.md 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

pyzeebe-1.0.0.tar.gz (19.9 kB view hashes)

Uploaded Source

Built Distribution

pyzeebe-1.0.0-py3-none-any.whl (24.5 kB view hashes)

Uploaded Python 3

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