The goal for this application is:
- Learn Python, QML & SQL
- Make a nice looking application without going overboard
- Able to run from Linux & Windows (runs much better in Linux)
- Package it for usage in Windows & Linux (.exe & .pkg)
This application was developed in Linux, but checks were made in Windows (bare metal).
Maybe I will port backend to C++ at a later date, but will mean learning C++. I'm sure this will speed up the application immensely using Qt framework. This was what drew me to QML as I can develop the frontend and replace the backend if necessary. I have tried to decouple QML from Python as much as I can and just let QML display visuals.
- Cable sizing and selection
- Voltage drop analysis
- Vector and phase visualisations
- Basic electrical calculations
- Python 3.8 or later
- PySide6
- reportlab
- numpy
- Clone the repository:
git clone https://github.com/yourusername/electrical-calculator.git
cd electrical-calculator
- Install virtual environment via virtualenv:
virtualenv venv or python3.12 -m venv venv
source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Generate resources:
pyside6-rcc resources.qrc -o data/rc_resources.py
- Run the application:
python main.py
- Install build requirements:
pip install -r build_requirements.txt
- Run the build script:
python scripts/windows_build.py
- Create installer (requires NSIS):
- Install NSIS from https://nsis.sourceforge.io/
- Right-click installer/windows_installer.nsi and select "Compile NSIS Script"
The executable will be in the dist
folder, and the installer will be created as ElectricalCalculator_Setup.exe
.
- Python 3.8 or later
- PyInstaller
- PySide6
- NSIS (for creating installer)
electrical-calculator/
├── qml/components/ # Reusable QML components
├── qml/components/menus/ # Define all menus here
├── qml/pages/ # Main application pages
├── qml/calculators/ # Calculators
├── data/ # Data files and resources
├── icons/ # Application icons
├── docs/ # Documentation
└── scripts/ # Build automation scripts
This project is licensed under the MIT License - see the LICENSE
file for details.