A simple Python OEE Calculator
Project description
PyOEE-Calc: A Python Library for Performance Factor Calculation
The name of this distributable package (as defined in pyproject.toml) is performance_calculator.
🎯 Academic Objective (LO3)
This project was developed with the main goal of demonstrating Domain-Driven Design (DDD) Software Architecture, Modularization (LO3), and Object-Oriented Programming (OOP).
The oee-calc-lib repository houses the library that isolates the Domain Logic (OEE Performance calculation) from the Application Logic (e.g., the Django web interface and AWS integrations). This modular separation ensures the core calculation can be reused across any part of the system or in different future platforms.
⚙️ Installation (Development Use)
For the purpose of development and integration with the main project (e.g., your Django application), we recommend installing it in editable mode (-e). This utilizes the modern Python packaging standard defined in pyproject.toml.
-
Clone the Repository:
git clone [https://github.com/sergio-oliveira-br/oee-calc-lib](https://github.com/sergio-oliveira-br/oee-calc-lib) cd oee-calc-lib
-
Install into Your Main Virtual Environment (Editable Mode):
Replace
/full/path/to/with the actual location where you saved the library.# Ensure you are in your main Django project's virtual environment (venv-django) $ pip install -e /full/path/to/oee-calc-lib
The
-e(editable) flag ensures that any code change in the library's source directory (src/oee_lib) is immediately reflected in the main project.
📖 How to Use
The library is class-oriented and requires you to instantiate the OEECalculator class.
Usage Example (in your Django views.py):
# 1. Import the External Library
# NOTE: The import path uses the source folder name 'oee_lib'.
from oee_lib.calculator import OEECalculator
# 1.1. Instantiate the class
oee_calculator = OEECalculator()
# 1.2. Input Data
# nominal_rate_ref: Ideal Rate
nominal_rate_ref = 600.0 # Units/Hour
# actual_rate_from_user: Actual Rate
actual_rate_from_user = 580.0 # Units/Hour
# 2. Invoke the core calculation method
performance = oee_calculator.calculate_performance_rate(
actual_rate=actual_rate_from_user,
nominal_rate=nominal_rate_ref
)
# 3. The result will be displayed in percentage.
print(f"Performance: {performance}")
# Expected result: 96.67%
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file performance_calculator-1.0.1.tar.gz.
File metadata
- Download URL: performance_calculator-1.0.1.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
897cf8d8deb3ba71d93148cb13dd9767c5548d67853b0e0f27d8c44ba55895a3
|
|
| MD5 |
fbb574db41c4b89a3922d64587003d9a
|
|
| BLAKE2b-256 |
19b20bfdc89c10a337e6de485c6b20f0ef039b1ec32e55b3bb07eda7745e4556
|
File details
Details for the file performance_calculator-1.0.1-py3-none-any.whl.
File metadata
- Download URL: performance_calculator-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2999368ab3fb9ba860b91264773574be340602b353627b7754fef9777be18f7c
|
|
| MD5 |
ce07d98288532e6f26fbddf17f37f0c3
|
|
| BLAKE2b-256 |
2a37df0384aa2f7f740d6a7977aa0cbc6b1735302db816de6f592ada549d15bd
|