alle Default files rein

This commit is contained in:
mistangl
2026-04-10 12:11:52 +02:00
commit 385e33e882
12 changed files with 424 additions and 0 deletions

89
.gitignore vendored Normal file
View File

@@ -0,0 +1,89 @@
# ---> Python
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# IDEs
.spyderproject
.spyproject
.ropeproject
.mypy_cache/
.dmypy.json
dmypy.json
.pyre/
.pytype/
cython_debug/
.pdm.toml
__pypackages__/
/site-packages
/site
# Jupyter
.ipynb_checkpoints
profile_default/
ipython_config.py
# Benutzerdefiniert
/data
/work
/log
/results

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 Michael Stangl, on GitHub mistamichael
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

98
README.md Normal file
View File

@@ -0,0 +1,98 @@
# plantplan
> Python-Projekttemplate mit Standard-Verzeichnisstruktur und Umgebungsverwaltung.
## Projektstruktur
```
plantplan/
├── bin/ # Skripte zur Umgebungsverwaltung
│ ├── setenv.bat/.sh # Umgebungsvariablen setzen
│ ├── install_py.bat/.sh # venv erstellen + pip install
│ ├── activate_venv.bat/.sh # venv aktivieren
│ └── get_cmd.bat/.sh # Shell mit Umgebung öffnen
├── cfg/ # Konfigurationsdateien (INI/JSON)
├── data/ # Eingabedaten (nicht im Git)
├── doc/ # Dokumentation
├── examples/ # Beispieldateien
├── lib/ # Python-Quellcode / Bibliothek
├── log/ # Log-Dateien (nicht im Git)
├── results/ # Ergebnisse / Ausgaben (nicht im Git)
├── tests/ # Unit Tests
├── .gitignore
├── LICENSE
├── README.md
└── requirements.txt
```
## Umgebungsvariablen
Nach dem Ausführen von `setenv` stehen folgende Variablen bereit:
| Variable | Beschreibung |
|----------------|---------------------------|
| `PROJECT` | Wurzelverzeichnis |
| `PV_BIN` | Skriptverzeichnis |
| `PV_LIB` | Python-Quellcode |
| `PV_CFG` | Konfigurationsdateien |
| `PV_DATA` | Eingabedaten |
| `PV_LOG` | Log-Dateien |
| `PV_RESULTS` | Ergebnisse |
| `PV_EXAMPLES` | Beispieldateien |
| `PYTHONPATH` | Erweitert um `PV_LIB` |
## Installation
### Voraussetzungen
- Python 3.10 oder höher
### Setup (Windows)
```bat
bin\install_py.bat
```
### Setup (Linux / macOS)
```bash
bash bin/install_py.sh
```
Erstellt `.venv` und installiert alle Pakete aus `requirements.txt`.
## Nutzung
### Umgebung setzen (Windows)
```bat
bin\setenv.bat
```
### Umgebung setzen (Linux / macOS)
```bash
source bin/setenv.sh
```
### Shell mit gesetzten Variablen öffnen
```bat
bin\get_cmd.bat # Windows
source bin/get_cmd.sh # Linux / macOS
```
### venv aktivieren
```bat
bin\activate_venv.bat # Windows
source bin/activate_venv.sh # Linux / macOS
```
## Lizenz
MIT License — siehe [LICENSE](LICENSE)
## Autor
Michael Stangl (GitHub: mistamichael)

20
bin/activate_venv.bat Normal file
View File

@@ -0,0 +1,20 @@
@echo off
REM ================================================================
REM PLANTPLAN - Python Virtual Environment aktivieren
REM ================================================================
call "%~dp0setenv.bat"
if not exist "%PROJECT%\.venv" (
echo FEHLER: Virtual environment nicht gefunden.
echo Bitte zuerst bin\install_py.bat ausfuehren.
exit /b 1
)
call "%PROJECT%\.venv\Scripts\activate.bat"
echo Virtuelle Umgebung aktiviert.
echo Python-Version:
python --version
echo.
echo Installierte Pakete:
pip list

23
bin/activate_venv.sh Normal file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# ================================================================
# PLANTPLAN - Python Virtual Environment aktivieren
# ================================================================
# Dieses Skript muss gesourct werden: source bin/activate_venv.sh
# ================================================================
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/setenv.sh"
if [ ! -d "$PROJECT/.venv" ]; then
echo "FEHLER: Virtual environment nicht gefunden."
echo "Bitte zuerst bin/install_py.sh ausfuehren."
return 1
fi
source "$PROJECT/.venv/bin/activate"
echo "Virtuelle Umgebung aktiviert."
echo "Python-Version:"
python --version
echo ""
echo "Installierte Pakete:"
pip list

7
bin/get_cmd.bat Normal file
View File

@@ -0,0 +1,7 @@
@echo off
REM ================================================================
REM PLANTPLAN - Shell mit gesetzten Umgebungsvariablen öffnen
REM ================================================================
call "%~dp0setenv.bat"
start cmd /k "echo PLANTPLAN Umgebung aktiv. && echo PROJECT=%PROJECT%"

12
bin/get_cmd.sh Normal file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# ================================================================
# PLANTPLAN - Shell mit gesetzten Umgebungsvariablen öffnen
# ================================================================
# Verwendung: source bin/get_cmd.sh
# ================================================================
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/setenv.sh"
# Neue interaktive Shell starten (mit gesetzten Umgebungsvariablen)
exec "$SHELL"

22
bin/install_py.bat Normal file
View File

@@ -0,0 +1,22 @@
@echo off
REM ================================================================
REM PLANTPLAN - Python Virtual Environment einrichten
REM ================================================================
REM Erstellt .venv und installiert Abhängigkeiten aus requirements.txt
REM ================================================================
call "%~dp0setenv.bat"
if not exist "%PROJECT%\.venv" (
echo Initialisiere Python virtual environment...
py -m venv "%PROJECT%\.venv" --upgrade-deps
echo Erfolgreich.
call "%PROJECT%\.venv\Scripts\activate.bat"
echo Installiere erforderliche Python Packages...
pip install -r "%PROJECT%\requirements.txt" -q
echo Erfolgreich.
deactivate
) else (
echo Erforderliche Python Packages bereits installiert!
)

23
bin/install_py.sh Normal file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# ================================================================
# PLANTPLAN - Python Virtual Environment einrichten
# ================================================================
# Erstellt .venv und installiert Abhängigkeiten aus requirements.txt
# ================================================================
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/setenv.sh"
if [ ! -d "$PROJECT/.venv" ]; then
echo "Initialisiere Python virtual environment..."
python3 -m venv "$PROJECT/.venv" --upgrade-deps
echo "Erfolgreich."
source "$PROJECT/.venv/bin/activate"
echo "Installiere erforderliche Python Packages..."
pip install -r "$PROJECT/requirements.txt" -q
echo "Erfolgreich."
deactivate
else
echo "Erforderliche Python Packages bereits installiert!"
fi

57
bin/setenv.bat Normal file
View File

@@ -0,0 +1,57 @@
@echo off
REM ================================================================
REM PLANTPLAN - Umgebungsvariablen Setup
REM ================================================================
echo Setting up environment variables for PLANTPLAN ...
REM Basis-Projektpfad (aktueller Ordner)
set "PROJECT=%~dp0.."
if "%PROJECT:~-6%"=="bin\.." set "PROJECT=%PROJECT:~0,-6%"
if "%PROJECT:~-1%"=="\" set "PROJECT=%PROJECT:~0,-1%"
REM Pfade für verschiedene Komponenten
set "PV_BIN=%PROJECT%\bin"
set "PV_LIB=%PROJECT%\lib"
set "PV_DATA=%PROJECT%\data"
set "PV_CFG=%PROJECT%\cfg"
set "PV_LOG=%PROJECT%\log"
set "PV_TESTS=%PROJECT%\tests"
set "PV_RESULTS=%PROJECT%\results"
set "PV_EXAMPLES=%PROJECT%\examples"
REM Python-Pfad erweitern (nur wenn noch nicht vorhanden)
echo %PYTHONPATH% | find /i "%PV_LIB%" >nul
if errorlevel 1 (
set "PYTHONPATH=%PV_LIB%;%PYTHONPATH%"
)
REM Ordner erstellen falls sie nicht existieren
if not exist "%PV_BIN%" mkdir "%PV_BIN%"
if not exist "%PV_CFG%" mkdir "%PV_CFG%"
if not exist "%PV_LIB%" mkdir "%PV_LIB%"
if not exist "%PV_DATA%" mkdir "%PV_DATA%"
if not exist "%PV_LOG%" mkdir "%PV_LOG%"
if not exist "%PV_RESULTS%" mkdir "%PV_RESULTS%"
if not exist "%PV_EXAMPLES%" mkdir "%PV_EXAMPLES%"
REM Umgebungsvariablen anzeigen
echo.
echo ================================================================
echo PLANTPLAN ENVIRONMENT SETUP COMPLETE
echo ================================================================
echo PROJECT = %PROJECT%
echo PV_BIN = %PV_BIN%
echo PV_CFG = %PV_CFG%
echo PV_LIB = %PV_LIB%
echo PV_DATA = %PV_DATA%
echo PV_RESULTS = %PV_RESULTS%
echo PV_LOG = %PV_LOG%
echo PV_EXAMPLES = %PV_EXAMPLES%
echo PYTHONPATH = %PYTHONPATH%
echo ================================================================
echo.
REM Optionally keep window open
if "%1"=="--keep-open" pause

46
bin/setenv.sh Normal file
View File

@@ -0,0 +1,46 @@
#!/usr/bin/env bash
# ================================================================
# PLANTPLAN - Umgebungsvariablen Setup
# ================================================================
# Dieses Skript muss gesourct werden: source bin/setenv.sh
# ================================================================
echo "Setting up environment variables for PLANTPLAN ..."
# Basis-Projektpfad (übergeordnetes Verzeichnis von bin/)
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export PROJECT="$(cd "$SCRIPT_DIR/.." && pwd)"
# Pfade für verschiedene Komponenten
export PV_BIN="$PROJECT/bin"
export PV_LIB="$PROJECT/lib"
export PV_DATA="$PROJECT/data"
export PV_CFG="$PROJECT/cfg"
export PV_LOG="$PROJECT/log"
export PV_TESTS="$PROJECT/tests"
export PV_RESULTS="$PROJECT/results"
export PV_EXAMPLES="$PROJECT/examples"
# Python-Pfad erweitern (nur wenn noch nicht vorhanden)
if [[ ":$PYTHONPATH:" != *":$PV_LIB:"* ]]; then
export PYTHONPATH="$PV_LIB:$PYTHONPATH"
fi
# Ordner erstellen falls sie nicht existieren
mkdir -p "$PV_BIN" "$PV_CFG" "$PV_LIB" "$PV_DATA" "$PV_LOG" "$PV_RESULTS" "$PV_EXAMPLES"
echo ""
echo "================================================================"
echo "PLANTPLAN ENVIRONMENT SETUP COMPLETE"
echo "================================================================"
echo "PROJECT = $PROJECT"
echo "PV_BIN = $PV_BIN"
echo "PV_CFG = $PV_CFG"
echo "PV_LIB = $PV_LIB"
echo "PV_DATA = $PV_DATA"
echo "PV_RESULTS = $PV_RESULTS"
echo "PV_LOG = $PV_LOG"
echo "PV_EXAMPLES = $PV_EXAMPLES"
echo "PYTHONPATH = $PYTHONPATH"
echo "================================================================"
echo ""

6
requirements.txt Normal file
View File

@@ -0,0 +1,6 @@
# Python-Abhängigkeiten für plantplan
# Installieren mit: pip install -r requirements.txt
# Beispiel-Abhängigkeiten anpassen nach Bedarf:
# pydantic >= 2.0.0
# pytest >= 9.0.0