Metadata-Version: 2.4
Name: xplan-tools
Version: 1.15.0
Summary: Manage XPlanung data
License: EUPL-1.2-or-later
License-File: LICENSE.md
Author: Tobias Kraft
Author-email: tobias.kraft@gv.hamburg.de
Requires-Python: >=3.10,<3.14
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: Pydantic :: 2
Classifier: License :: OSI Approved :: European Union Public Licence 1.2 (EUPL 1.2)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Dist: alembic (>=1.16.4,<2)
Requires-Dist: deprecated
Requires-Dist: gdal (>=3.6.3)
Requires-Dist: geoalchemy2 (>=0.16)
Requires-Dist: httpx (>=0.27.2)
Requires-Dist: lxml (>=5.3.0)
Requires-Dist: numpy (>=1.26.4)
Requires-Dist: openpyxl (>=3.1)
Requires-Dist: pandas (>=2.2.2)
Requires-Dist: psycopg[binary] (>=3.2)
Requires-Dist: pydantic (>=2.10.3)
Requires-Dist: pydantic-extra-types[semver]
Requires-Dist: pydantic-settings (>=2.12.0,<3)
Requires-Dist: python-dateutil (>=2.9,<3)
Requires-Dist: pytz (>=2024.1)
Requires-Dist: pyyaml (>=6)
Requires-Dist: roman (>=4.2)
Requires-Dist: shapely (>=2.0.4)
Requires-Dist: sqlalchemy (>=2.0.36)
Requires-Dist: typer (>=0.15.0)
Project-URL: Homepage, https://gitlab.opencode.de/xleitstelle/xplanung/xplan-tools
Project-URL: Issues, https://gitlab.opencode.de/xleitstelle/xplanung/xplan-tools/-/issues
Description-Content-Type: text/markdown

# XPlan-Tools

[![coverage report](https://gitlab.opencode.de/xleitstelle/xplanung/xplan-tools/badges/main/coverage.svg)](https://gitlab.opencode.de/xleitstelle/xplanung/xplan-tools/-/commits/main)
[![pipeline status](https://gitlab.opencode.de/xleitstelle/xplanung/xplan-tools/badges/main/pipeline.svg)](https://gitlab.opencode.de/xleitstelle/xplanung/xplan-tools/-/commits/main)
[![Latest Release](https://gitlab.opencode.de/xleitstelle/xplanung/xplan-tools/-/badges/release.svg)](https://gitlab.opencode.de/xleitstelle/xplanung/xplan-tools/-/releases)

**[Documentation](https://xplan-tools-xleitstelle-xplanung-8446a974e8119a851af45bf94e0717.usercontent.opencode.de/)** | **[Repository](https://gitlab.opencode.de/xleitstelle/xplanung/xplan-tools)**


A Python library to provide some useful means when working with XPlanung, XTrasse and XWaermeplan data, e.g. format conversion, version migration and database setup. Relies on [Pydantic](https://pydantic.dev) for a Python representation of the XPlanung/XTrasse/XWaermeplan model as well as serialization/de-serialization and validation.

While it comes with a CLI, its modules are also meant to provide other applications a Python representation as well as an interface for XPlanung/XTrasse/XWaermeplan data.

## Features

* Conversion between GML, JSON-FG and DB encodings of XPlanung/XTrasse/XWaermeplan data.
* Migration from older versions of XPlanung to the latest one.
* Set up a database to store XPlanung data. Supports [PostgreSQL](https://www.postgresql.org)/[PostGIS](https://postgis.net) as well as [GeoPackage](https://www.geopackage.org) and [SpatiaLite](https://www.gaia-gis.it/fossil/libspatialite/index) SQLite databases.
* Transformation from XPlanung to [INSPIRE PLU](https://inspire-mif.github.io/uml-models/approved/fc/#_P5531) based on the [official mappings](https://xleitstelle.de/xplanung/transformation-inspire/releases).
* Adding style properties (stylesheetId, schriftinhalt) to XPlanung presentational objects based on [defined rules](https://xplan-tools-xleitstelle-xplanung-8446a974e8119a851af45bf94e0717.usercontent.opencode.de/style_defs/).

## Installation

### Pixi
This project uses [Pixi](https://pixi.sh) for package management. To install this repo with a self-contained environment, run

```shell
git clone https://gitlab.opencode.de/xleitstelle/xplanung/xplan-tools.git
cd xplan-tools
pixi install
```
### Python >= v3.10

[GDAL](https://gdal.org) and its Python bindings are required, so you need to make sure the GDAL system library and Python package versions match.

Download the repository:

```shell
git clone https://gitlab.opencode.de/xleitstelle/xplanung/xplan-tools.git
cd xplan-tools
pip install .
```
Or install from PyPI:
```shell
pip install xplan-tools
```

### Docker
Images are provided in the [container registry](https://gitlab.opencode.de/xleitstelle/xplanung/xplan-tools/container_registry) (see [docs](https://xplan-tools-xleitstelle-xplanung-8446a974e8119a851af45bf94e0717.usercontent.opencode.de/how-to-guides/#container-image-usage)).


## Development
Make sure [Pixi](https://pixi.sh) is installed and run

```shell
git clone https://gitlab.opencode.de/xleitstelle/xplanung/xplan-tools.git
cd xplan-tools
make dev
```

## License

The code in this repository is licensed under the [EUPL-1.2-or-later](https://joinup.ec.europa.eu/collection/eupl)

&copy; [XLeitstelle](https://xleitstelle.de), 2025

