### Install gaeb-parser using pip
Source: https://context7.com/meindonut/gaeb-parser/llms.txt
This command installs the gaeb-parser library using pip, making it available for use in your Python projects. Ensure you have pip installed and configured correctly.
```bash
pip install gaeb-parser
```
--------------------------------
### Analyze and export GAEB DataFrame
Source: https://context7.com/meindonut/gaeb-parser/llms.txt
Provides examples of how to work with the Pandas DataFrame generated by the GAEB Parser. It explains the DataFrame columns, demonstrates filtering data by trade or quantity, and shows how to export the DataFrame to Excel and CSV formats. It also includes a snippet to print the total number of items in the DataFrame.
```python
from gaeb_parser import XmlGaebParser
import pandas as pd
parser = XmlGaebParser("bauausfuehrung.x83")
df = parser.get_df()
# DataFrame columns explained:
# - Projekt: Project name
# - OZ: Item number (Ordnungszahl), e.g., "01.01.0010"
# - Gewerk: Main trade/category (Hauptgewerk)
# - Untergewerk: Sub-trade/category
# - Kurztext: Short description (outline text)
# - Qty: Quantity
# - QU: Unit (e.g., "m³", "m²", "psch")
# - TLK: Reference number (WIC number)
# - Langtext: Long description (detailed text)
# - Info: Additional info (opt=optional, Sum=summary, etc.)
# Filter by trade
rohbau_items = df[df['Gewerk'] == 'Rohbauarbeiten']
# Get items with quantities
quantified_items = df[df['Qty'] != '']
# Export to Excel
df.to_excel("gaeb_export.xlsx", index=False)
# Export to CSV
df.to_csv("gaeb_export.csv", index=False, encoding='utf-8')
# Calculate total items
print(f"Total items: {len(df)}") # e.g., 35
```
--------------------------------
### Instantiate and use XmlGaebParser to parse GAEB XML
Source: https://context7.com/meindonut/gaeb-parser/llms.txt
Demonstrates how to instantiate the XmlGaebParser class with a GAEB XML file path. It then shows how to retrieve the parsed data as a Pandas DataFrame and print the first few rows. The DataFrame includes columns like Project, OZ, Gewerk, Kurztext, Qty, and Langtext.
```python
from gaeb_parser import XmlGaebParser
# Parse a GAEB XML file
parser = XmlGaebParser("path/to/your/gaeb_file.x83")
# Access the parsed data as a Pandas DataFrame
df = parser.get_df()
# DataFrame columns: ['Projekt', 'OZ', 'Gewerk', 'Untergewerk', 'Kurztext', 'Qty', 'QU', 'TLK', 'Langtext', 'Info']
print(df.head())
# Output example:
# Projekt OZ Gewerk Untergewerk Kurztext Qty QU TLK Langtext Info
# 0 BVBS GAEB Muster - (Gewerklos) (Untergewerklos) Vorbemerkung ...detailed text... pre
# 1 BVBS GAEB Muster 01.01 Rohbauarbeiten Erdarbeiten Position 1 5.0 m³ ...text...
```
--------------------------------
### Access project metadata from GAEB XML
Source: https://context7.com/meindonut/gaeb-parser/llms.txt
Shows how to extract various metadata from a parsed GAEB XML file using the XmlGaebParser. This includes accessing the project name, GAEB file information, project details, award information, owner details, bill of quantities info, and the data phase indicator.
```python
from gaeb_parser import XmlGaebParser
parser = XmlGaebParser("construction_project.x83")
# Project name
print(parser.project_name) # e.g., "BVBS GAEB Muster"
# GAEB file version info
print(parser.gaeb_info)
# {'Version': '3.3', 'ProgSystem': 'MyApp', ...}
# Project details
print(parser.project_info)
# {'NamePrj': 'BVBS GAEB Muster', 'LblPrj': 'Project Label', ...}
# Award/tender information
print(parser.award_info)
# {'Cur': 'EUR', 'DP': '83', ...}
# Owner information
print(parser.own_info)
# {'AwardNo': 'BVBS-4711', ...}
# Bill of quantities info
print(parser.boq_info)
# {'Name': 'BVBS GAEB Bauausf.', ...}
# Data phase indicator (83 = execution phase)
print(parser.dp) # 83
```
--------------------------------
### Configure text translation settings in GAEB Parser
Source: https://context7.com/meindonut/gaeb-parser/llms.txt
Illustrates how to adjust text translation settings within the XmlGaebParser to control line break handling for different text elements in GAEB XML content. It demonstrates modifying settings like `text_translation_ul_insert_breaks_at_br` and `text_translation_insert_breaks_after_paragraph`, and then reloading the DataFrame with the new configurations.
```python
from gaeb_parser import XmlGaebParser
parser = XmlGaebParser("project.x83")
# Configure text translation before parsing (set in __init__ or modify and reload)
# These settings control how line breaks are inserted in parsed text
# Insert line breaks at
tags in unordered lists
parser.text_translation_ul_insert_breaks_at_br = False # default
# Insert line breaks at
tags in regular text
parser.text_translation_insert_breaks_at_br = True # default
# Insert line breaks after paragraphs
parser.text_translation_insert_breaks_after_paragraph = True # default
# Insert line breaks after text elements
parser.text_translation_insert_breaks_after_text = False # default
# Reload file with new settings
parser.load_df("project.x83")
df = parser.get_df()
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.