Skip to main content

Script collection to sync data from local sources to a wattro node

Project description

Wattro Sync

Ermöglicht es, Daten aus einer lokalen Quelle mit Wattro zu synchronisieren.

Voraussetzung

  • Verbindung zu wattro (https) und Quellsystem
  • python >= 3.10 und pip

Installation

  • pip install wattro-sync

Einrichten

Die zentrale Konfigurationsdatei

Die Synchronisation beruht auf einer Konfigurationsdatei, welche mit python -m wattro_sync.setup ZIEL QUELLE erzeugt oder aktualisiert werden kann (siehe python -m wattro_sync.setup --help für alle gültigen Optionen).

Im Prozess werden je nach Ziel- und Quelltyp verschiedene Eingaben abgefragt und die Datenverfügbarkeit geprüft. Nur gültige Werte werden in die Konfigurationsdatei geschrieben.

ACHTUNG

Für Importe aus Mosaik muss aus technischen Gründen ein View angesporchen werden, welcher

  • die Datensätze auf maximal 2k beschränkt und
  • die Datensätze nach Änderungsdatum sortiert

Die Konfigurationsdatei kann von Hand angepasst werden. Mit python -m wattro_sync.sync --dry kann geprüft werden, ob die Synchronisation wie erwartet arbeitet.

Mail Infos

Um Informationen zum Erfolg der Synchornisation zu bekommen, können Mails verschickt werden. Das "log_level" entspricht dabei einem numerischen Wert nach dem Python Log Level Schema.

Insbesondere:

Level numerischer Wert Mail wird versendet bei...
ERROR 40 Fehler beim Synchronisieren
INFO 20 Änderung von Datensätzen
DEBUG 10 Aufruf des Scripts

Synchronisation

Mit python -m wattro_sync.sync werden die Daten synchronisiert. Siehe python -m wattro_sync.sync --help für mehr.

Development

Pre Commit tooling

# requires black, mypy and bandit to be installed (via pip)
# none of the following commands should produce output on the second run.
# lint
black wattro_sync -q
# search for typing issues
mypy wattro_sync --no-error-summary --config-file mypy.ini
# search for common issues
bandit -r wattro_sync -c bandit.yaml -q

Build

# requires build and twine to be installed (via pip)
python -m build
twine upload dist/*

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

wattro_sync-0.3.0.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

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

wattro_sync-0.3.0-py3-none-any.whl (26.0 kB view details)

Uploaded Python 3

File details

Details for the file wattro_sync-0.3.0.tar.gz.

File metadata

  • Download URL: wattro_sync-0.3.0.tar.gz
  • Upload date:
  • Size: 20.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for wattro_sync-0.3.0.tar.gz
Algorithm Hash digest
SHA256 34680dfcaf78beba8d99e897bdf27749bce0aad9ee0948f6fce7780e559bd1a6
MD5 a9547227da71845195156d32015594bd
BLAKE2b-256 6587a9cf4361b457932fa3e1fb9c89793465ff7c413b982c021d9bfab73fc5d3

See more details on using hashes here.

File details

Details for the file wattro_sync-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: wattro_sync-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 26.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for wattro_sync-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 78086a991e6c7fd9f0e31725a73cc382a593fc0c9622f6160c4e1e48cabd555f
MD5 633c004327e5aba5451b43ad3fc80296
BLAKE2b-256 75cf38bc3f7e368c4d344af3fa9e56d4fd4bb278e8a4ee29969b4916597ceabd

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