Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kreative-performative-individuals/kpi-engine
KPI Calculation Engine
https://github.com/kreative-performative-individuals/kpi-engine
docker fastapi interpreter kpi-engine numexpr poetry
Last synced: about 1 month ago
JSON representation
KPI Calculation Engine
- Host: GitHub
- URL: https://github.com/kreative-performative-individuals/kpi-engine
- Owner: Kreative-Performative-Individuals
- License: mit
- Created: 2024-11-08T19:14:05.000Z (about 2 months ago)
- Default Branch: dev
- Last Pushed: 2024-11-21T16:33:16.000Z (about 1 month ago)
- Last Synced: 2024-11-21T17:27:59.455Z (about 1 month ago)
- Topics: docker, fastapi, interpreter, kpi-engine, numexpr, poetry
- Language: Dockerfile
- Homepage:
- Size: 104 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# KPI-Engine
[![CI](https://img.shields.io/github/actions/workflow/status/Kreative-Performative-Individuals/KPI-Engine/ci.yml)](https://github.com/Kreative-Performative-Individuals/KPI-Engine/actions)
[![License](https://img.shields.io/github/license/Kreative-Performative-Individuals/KPI-Engine)](https://github.com/Kreative-Performative-Individuals/KPI-Engine/blob/dev/LICENSE)The KPI Calculation Engine is a Python library that provides the core logic when it comes to compute requested KPIs from a given storage system.
---
## ๐ Repository Contents
The repository contains the following files and directories
```bash
๐ Project Root
โโโ ๐ src
โ โโโ ๐ app
โ โ โโโ ๐ kpi_engine
โ โ โ โโโ ๐ค grammar.py
โ โ โ โโโ ๐ค kpi_engine.py
โ โ โ โโโ ๐ฉ kpi_request.py
โ โ โ โโโ ๐ค kpi_response.py
โ โ โโโ โ db.py
โ โ โโโ โ models.py
โ โ โโโ ๐ main.py
โ โโโ ๐ tests
โ โ โโโ ๐งช test_kpi_engine.py
โโโ ๐ .github
โโโ ๐ LICENSE
โโโ ๐ README.md
โโโ ๐ณ Dockerfile
โโโ ๐ pyproject.toml
โโโ ๐ poetry.lock
```
In order the contents are
- **`src`**
A directory containing the source code.
- **`app`**
A directory containing the api logic.
- **`kpi_engine`**
A directory containing the core logic of the KPI Engine.
- **`grammar.py`**
A Python module that defines the accepted grammar for KPI calculation.
- **`kpi_engine.py`**
A Python module that contains the engine itself.
- **`kpi_request.py`**
A Python module that defines the structure of the KPI requests.
- **`kpi_response.py`**
A Python module that defines the structure of the KPI responses.
- **`db.py`**
A Python module that contains the database connection logic.
- **`models.py`**
A Python module that defines the database models.
- **`main.py`**
A Python module that contains the main entry point of the application.
- **`tests`**
A directory containing the unit tests for the KPI Engine.
- **`test_kpi_engine.py`**
A Python script that contains unit tests for the KPI Engine.
- **`.github`**
A directory containing the GitHub Actions workflows, including CODEOWNERS.
- **`LICENSE`**
A standard MIT license file.
- **`README.md`**
A detailed README file containing information about the project, setup instructions, and other relevant details.
- **`Dockerfile`**
A Dockerfile that contains that can be executed following the instructions as below.
- **`pyproject.toml`**
Project configuration file with all libraries and tools.
- **`poetry.lock`**
Poetry-generated lock file.---
## ๐ Getting Started
### Prerequisites
- Docker should be installed on your machine.
- Git should be installed on your machine.---
### 1. Clone the Repository
Clone this repository to your local machine using the following command:
```bash
git clone https://github.com/Kreative-Performative-Individuals/KPI-Engine.git
```This will create a new directory named `KPI-Engine` in your current working directory.
### 2. Build the Docker Image
Navigate to the project directory:
```bash
cd KPI-Engine
```Build the Docker image using the following command:
```bash
docker build --tag kpi-engine .
```### 3. Run the Docker Container
Run the following command to start the KPI Engine Docker container:
```bash
docker run -d --name KPI-Engine -p 8000:8000 kpi-engine
```This command will start a new Docker container named `KPI-Engine` and expose the application on port `8000`.
### 4. Access the API
You can now access the KPI Engine API by visiting `http://localhost:8000` in your web browser or using tools like Postman.
### 5. Stopping the Container
To stop the running container, use the following command:
```bash
docker stop KPI-Engine
```Check the status of the container using the following command:
```bash
docker ps -a
```### 6. Removing the Container and the Image
To remove the container, use the following command:
```bash
docker rm KPI-Engine
```To remove the image, use the following command:
```bash
docker rmi kpi-engine
```---