eventit-py

Core event creation library. Define events via pydantic models and log to a backend


License
CNRI-Python-GPL-Compatible
Install
pip install eventit-py==0.1.1

Documentation

Poetry Ruff Actions status

EventIT Library for Python

This repo is intended to be the core event tracking framework that will be built-upon in other applications

Note: As of now, this is just a personal project. Any advise or contributions towards the direction of this project would be greatly appreciated. Feel free to make a Github Issue/discussion about future work.

Documentation link

Overview

In this context, an event is a "log", as a dictionary with pre-defined fields. These fields are defined in Pydantic models, which validate the event during the logging process.

Features

  • Pydantic validation
  • Custom user-defined metrics
  • Support for various backend data-storage services (MongoDB as primary data backend)
  • Support for different "types" of events, such as rate-based, authentication-based, etc. (TODO)
  • Integration with cross-platform frameworks, such as OpenTelemetry, Flask, FastAPI, etc. (TODO)

Developer details

I have setup pre-commit in this repository to execute pytest, ruff linting, and ruff formatting before commits. Poetry is used for dependency management. To setup this environment for development, first ensure Poetry is installed.

To install all dependencies for eventit-py, run the following commands from the base directory of this project.

poetry config virtualenvs.in-project true
poetry install --with=dev

Next, install pre-commit on your machine, and install it into this project

pip install pre-commit
pre-commit install

For sanity, it is beneficial to run pre-commit on all files to ensure consistency

pre-commit run --all-files

From this point on, pre-commit will be run on every commit