Skip to content

Getting Started

  Welcome to the Getting Started section! This guide will help you install and configure Pyventus in your project. For more detailed information on how to use this package, you can refer to the Pyventus Tutorials or API Reference.

Requirements

  By default, Pyventus' core functionalities and default event emitter implementations, such as the AsyncIO Event Emitter, and the Executor Event Emitter, only require Python 3.10+ with no additional dependencies. However, these requirements may expand if you opt to use alternative built-in event emitter implementations.

Installation

  Pyventus is published as a Python package and can be installed using pip, ideally in a virtual environment for proper dependency isolation. To get started, open up a terminal and install Pyventus with the following command:

pip install pyventus

Optional Dependencies

   While Pyventus primarily relies on the Python standard library, it also supports optional dependencies to access additional features, as shown below:

Supported Library Integrations

  • Celery ─ Pyventus integrates with Celery using the CeleryEventEmitter, enabling event emissions to be executed on Celery worker nodes to improve task processing. To install Pyventus with Celery support, use the following command:
    pip install pyventus[celery] (1)
    
    1. Optional Package Dependencies

        This package includes some optional dependencies. For more information, please visit the Celery bundles documentation.

      These optional dependencies can be installed as described in their individual documentation. For example:

      pip install celery[...]
      


  • Redis Queue (RQ) ─ Pyventus integrates with Redis Queue (RQ) using the RQEventEmitter, allowing event emissions to run as background jobs through RQ's asynchronous workers. To install Pyventus with RQ support, use the following command:
    pip install pyventus[rq]
    
  • Supported Framework Integrations

  • FastAPI ─ Pyventus integrates with the FastAPI framework using the FastAPIEventEmitter, enabling event-driven architectures to be built directly into FastAPI applications. The emitter leverages FastAPI's background tasks to asynchronously process event emissions without blocking responses. To install Pyventus with FastAPI integration, use the following command:
    pip install pyventus[fastapi] (1)
    
    1. Optional Package Dependencies

        This package includes some optional dependencies. For more information, please visit the FastAPI optional dependencies.

      These optional dependencies can be installed as described in their individual documentation. For example:

      pip install fastapi[...]
      


You can install all of them with:

pip install pyventus[all]