Skip to main content

A simple Python OEE Calculator

Project description

PyOEE-Calc: A Python Library for Performance Factor Calculation

GitHub last commit License Python Version

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.

  1. 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
    
  2. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

performance_calculator-1.0.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

performance_calculator-1.0.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file performance_calculator-1.0.0.tar.gz.

File metadata

  • Download URL: performance_calculator-1.0.0.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

Hashes for performance_calculator-1.0.0.tar.gz
Algorithm Hash digest
SHA256 43670b7962e764ec52a50bb6712cf5c03f177360fff1c870116a5e3cbaefd967
MD5 799f9dd3c5e384e8f551bfd0c82db9b0
BLAKE2b-256 bd0f779137486d569a4705c9f4f78d2c8357051897269b25f913c00f9defbadb

See more details on using hashes here.

File details

Details for the file performance_calculator-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for performance_calculator-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b1b3be96e0efb035b5e34f9615ca310b8fdbfeafb7e222112d7ea27b0643427
MD5 dcf2249e80dad14c9930ba581749cda3
BLAKE2b-256 1928195c24c1a602769eb19dc5c094ac379946328df37742e983f6b4a8f9ca14

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page