Skip to main content

gaeb

Python-Bibliothek zum Lesen, Schreiben, Konvertieren und Vergleichen von GAEB-Dateien (AVA – Ausschreibung, Vergabe, Abrechnung im deutschen Bauwesen).

Für die Kommandozeile (info, show, convert, diff, validate) gibt es die zugehörige gaeb-cli: pip install gaeb-cli.

Features

  • GAEB DA XML 2.0–3.3 lesen und schreiben (automatische Versionserkennung, Multi-Version Writer)
  • GAEB 90 lesen und schreiben (.d80–.d89; Encoding-Autoerkennung)
  • GAEB 2000 lesen und schreiben (.p80–.p89)
  • Alle Austauschphasen: Mengenermittlung (31), Kostenermittlung (50–52), Vergabe (80–89, 83Z, 84Z, 86ZR, 86ZE), Handel/Handwerk (93–97)
  • BoQ Builder: programmatischer LV-Aufbau mit Auto-OZ-Generierung und Fluent API
  • Excel-Export (.xlsx) mit Hierarchie-Layout — optional via pip install gaeb[excel]
  • Document Diff: zwei LVs vergleichen, alle Felder prüfen, finanzielle Auswirkungen berechnen
  • XSD-Validierung gegen offizielle GAEB-Schemas (Phasen 80–87)
  • Preisspiegel- & Raumbuch-Modell für Angebotsvergleiche und räumliche Zuordnung
  • Security-Hardened: XXE-Prevention, Billion-Laughs-Schutz, Dateigrössen-Limit, Rekursionstiefenbegrenzung
  • Einheitliches Pydantic v2 Datenmodell für alle Formate

Installation

pip install gaeb

# Mit Excel-Export
pip install gaeb[excel]

Schnellstart

import gaeb

# Lesen
lv = gaeb.read_xml("ausschreibung.x83")
lv = gaeb.read_gaeb90("ausschreibung.d83")
lv = gaeb.read_gaeb2000("ausschreibung.p83")

# Metadaten
print(lv.titel_lv)        # LV-Titel
print(lv.phase)           # Phase.ANGEBOTSAUFFORDERUNG
print(lv.xml_version)     # "3.3" (nur bei DA XML)
print(lv.encoding)        # "cp850" (nur bei GAEB 90 / 2000)
print(lv.gesamtsumme)     # Decimal oder None

# Positionen
for pos in lv.alle_positionen:
    print(pos.oz, pos.kurztext, pos.menge, pos.einheit)

# Schreiben / Konvertieren
gaeb.write_xml(lv, "ausgabe.x83")
gaeb.write_xml(lv, "ausgabe_v32.x83", version="3.2")  # explizite Version
gaeb.write_gaeb90(lv, "ausgabe.d83")
gaeb.write_gaeb2000(lv, "ausgabe.p83")

# Excel-Export
gaeb.write_excel(lv, "ausgabe.xlsx")
gaeb.write_excel(lv, "ausgabe.xlsx", langtext=True)

# Zwei LVs vergleichen
lv_neu = gaeb.read_xml("angebot.x84")
result = gaeb.compare(lv, lv_neu)

print(result.only_in_old)        # gelöschte OZ-Nummern
print(result.only_in_new)        # neue OZ-Nummern
for pc in result.changed:
    print(pc.oz, pc.changes)
print(result.gesamtsumme_diff)   # finanzielle Differenz

# XSD-Validierung
fehler = gaeb.validate("ausschreibung.x83")
if fehler:
    print(fehler)

BoQ Builder

import gaeb

lv = (
    gaeb.BoQBuilder(
        phase=gaeb.Phase.ANGEBOTSAUFFORDERUNG,
        titel_lv="Hochwasserschutz",
        projekt="Testprojekt",
    )
    .titel("Erdarbeiten")
        .position("Bodenaushub", einheit="m³", menge=250, ep="12.50")
        .position("Bodentransport", einheit="m³", menge=250, ep="8.00")
    .end()
    .titel("Betonarbeiten")
        .untertitel("Fundamente")
            .position("Streifenfundament", einheit="m³", menge=30, ep="185.00")
        .end()
    .end()
    .build()
)

gaeb.write_xml(lv, "ausschreibung.x83")

OZ-Generierung basiert auf dem BoQBkdn-Schema (Standard: 2+2+4 Zeichen):

  • Titel: 01, 02, …
  • Untertitel: 0101, 0102, …
  • Position: 01000001, 01010001, …

Datenmodell

Leistungsverzeichnis
  ├── phase: Phase
  ├── titel_lv, projekt, auftraggeber, auftragnehmer
  ├── waehrung, xml_version, encoding
  ├── vorbemerkungen: list[str]
  ├── zeitvertrag_typ: str | None
  ├── boq_bkdn: list[BoQBkdn]
  ├── gesamtsumme: Decimal | None  (property)
  └── titel: list[Titel]
        ├── nummer, kurztext, langtext
        ├── positionen: list[Position]
        │     ├── oz, kurztext, langtext
        │     ├── menge, einheit, einheitspreis
        │     ├── gesamtpreis  (property: menge × EP)
        │     ├── gesamtbetrag, mwst, nachlass_prozent
        │     ├── pauschale, entfaellt, nicht_angeboten
        │     ├── stundenlohn, schwerpunkt, provis
        │     ├── typ: PositionTyp
        │     ├── aln_gruppe, aln_nummer, ep_anteile
        │     └── periodqty, min_menge, max_menge  (Z-Phasen)
        └── untertitel: list[Titel]  (rekursiv)

Unterstützte Phasen

Bereich Phasen
Mengenermittlung 31
Kostenermittlung 50, 51, 52
Vergabe (Procurement) 80–89, 83Z, 84Z, 86ZR, 86ZE
Handel / Handwerk 93–97

Optionale Abhängigkeiten

Extra Paket Feature
gaeb[excel] openpyxl ≥ 3.1 Excel-Export (.xlsx)

Lizenz

MIT – siehe LICENSE

Release files for gaeb 0.5.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gaeb 0.5.4
File Size Uploaded
gaeb-0.5.4.tar.gz 37.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gaeb 0.5.4
File Interpreter ABI Platform
gaeb-0.5.4-py3-none-any.whl Python 3 none any Details

Total release size: 87.7 kB

Release files / gaeb-0.5.4.tar.gz

Download URL gaeb-0.5.4.tar.gz
Size 37.6 kB
Tags Source
SHA-256 checksum
How to use checksums
45523cb31f887ac8a5ec3501551a659dff3721692c3b1073f9d364288364a0a3
BLAKE2b-256 checksum
How to use checksums
346f6620c84ddf16b668cb3fdb3819dbe65db94b58d45240b6c73e8d6e44996d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.

Transparency log

Release files / gaeb-0.5.4-py3-none-any.whl

Download URL gaeb-0.5.4-py3-none-any.whl
Size 50.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9a695135f0cb584a39fe2346838da7034f7869044a1876a9e8e8e3e0aa7b55f6
BLAKE2b-256 checksum
How to use checksums
b25399699a84620ce691b5c220dd9a3f92b59edecb615d09a944841f52c032af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.4 This release

2 release files

0.5.3

2 release files

0.5.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page