Skip to main content

SJI - Eine einfache Python-Bibliothek für Job-Initialisierung

Project description

SJI

Eine einfache Python-Bibliothek für die Initialisierung von Jobs/Skripten (Logging, Konfiguration, Ordnerstruktur).

Installation

pip install sji

Verwendung

from sji import SimpleJobInit

# __file__ an SimpleJobInit übergeben
sji = SimpleJobInit(__file__)

# Logger verwenden
sji.logger.info("Starte Job...")

# Konfiguration lesen (INI)
cfg = sji.config
value = cfg.get('section', 'key', fallback='default')

# Persistente Datei-Pfade erhalten
csv_path = sji.get_persistent_file_path('csv')

Dabei werden automatisch erzeugt/genutzt:

  • logs/.log (mit optionaler Rotation)
  • tmp/ Verzeichnis
  • .config.ini für Einstellungen

Minimalbeispiel für die INI-Datei

Datei: <skriptname>.config.ini im selben Verzeichnis wie das Skript

[logging]
level = INFO
log_rotation_when = midnight
log_rotation_backup_count = 7

[section]
key = some-value

API

Klasse: SimpleJobInit

  • SimpleJobInit(script_file_path: str)
    • Initialisiert Logging, lädt/prüft INI-Config, erzeugt Ordner (logs, tmp)
  • Eigenschaften
    • logger: konfigurierter logging.Logger
    • config: configparser.ConfigParser
  • Methoden
    • get_persistent_file_path(file_ending: str) -> str: gibt Pfad <skriptname>.<file_ending> zurück

Lizenz

MIT-Lizenz - siehe LICENSE für Details.

  • Project build with support of AI (Cursor IDE).

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

sji-0.1.2.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

sji-0.1.2-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file sji-0.1.2.tar.gz.

File metadata

  • Download URL: sji-0.1.2.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for sji-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4469358f3d784d7de79ff24e8c7840539a852c7fbc3b673aed5e249a8d78ac9f
MD5 bec2676972c5d91dbbf0afd4443b5415
BLAKE2b-256 b9489b8e453b7bba655d3082570e0e71e678e3726d9ba8911e93bd0ac05ef9bf

See more details on using hashes here.

File details

Details for the file sji-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: sji-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for sji-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6e909042c5432345a8eb4cd7e3d9e3dee4af1bf2c5e7c14e31ff4d7d657270f9
MD5 be6b5b1b6e7703b04ed07203b6a6e20b
BLAKE2b-256 b50f2dc08850422e956299b739f81b4dc58ab93aa953a3c8c069a8d47ad93a33

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