Skip to main content

A library for the GWSW-hydx exchange format

RioNED is going to release a new format for exchanging sewerage data called GWSW-hydx. hydxlib can be used to import sewerage data from a hydx format (*.csv) to 3Di native schematisation files.

For more information about GWSW-hydx: https://apps.gwsw.nl/item_hyddef

For more information about the database scheme of 3Di: https://docs.3di.live/

Purporse of this script is to exchange information between different formats. This means that this library doesn’t improve lacking or incorrect data. For example, it doesn’t remove double manholes on the same location. This libary does provide all kinds of checks with warning and error messages.

This tool is currently in development. Therefore only nodes, weirs, orifices and pumpstations are currently supported.

Installation

hydxlib is installed with:

$ pip install hydxlib

Running script

It’s possible to run this tool on command line or with python.

Commandline:

$ run-hydxlib path/to/hydx/dir path/to/threedi.sqlite

Python:

from hydxlib.scripts import run_import_export

run_import_export("path/to/hydx/dir", "path/to/threedi.sqlite")

Installation for development

Clone hydxlib from github and then install locally using pip + virtualenv:

$ virtualenv .venv
$ source .venv/bin/activate
$ pip install -e .[test]

There will be a script you can run like this:

$ run-hydxlib ...

It runs the main() function in hydxlib/scripts.py, adjust that if necessary. The script is configured in setup.py (see entry_points).

Run the tests regularly:

$ pytest hydxlib --cov

The code is linted automatically on each PR. To enable autoformatting locally, install pre-commit:

$ pre-commit install

Changelog of hydxlib

1.8.0 (2026-11-04)

  • Add Rana pipe visualisation mappings for OPL (slot or trench drain) and ITR (infiltration drain) connections (nens/rana#5129).

  • Resolve pipe friction type and coefficient from the target Rana material configuration, with defaults for missing configuration (nens/rana#5129).

  • Add a stable gwsw-hydx-import provenance tag to exported Rana objects (nens/rana#5129).

  • Fix GeoAlchemy warnings caused by manually serialized EWKT geometries (nens/rana#5129).

1.7.9 (2026-09-30)

  • Fix bug in run-hydxlib

1.7.8 (2026-07-02)

1.7.7 (2026-06-09)

  • Set weir cross-section shape to closed rectangle; set cross_section_height from OVS_VOH (mm to m) when present (nens/rana#4429).

  • Profiles without a shape now import with shape=NULL and width/height preserved; unknown shape logs a warning (nens/rana#4429).

1.7.6 (2026-05-11)

  • Support discharge_capacity import

1.7.5 (2026-04-10)

  • Set minimum threedi-schema to 0.300.18 or above.

1.7.4 (2025-05-26)

  • Fix importing connections without “identificatieknooppuntofverbinding” into channels (#53)

1.7.3 (2025-04-11)

  • Added SewerageType to lib.

1.7.2 (2025-03-18)

  • Set minimum threedi-schema version of 0.300.18 instead of hard pin.

1.7.1 (2025-03-17)

  • Skip adding pumps when node start and end are identical

1.7.0 (2025-03-12)

  • Support schema 300

  • Drop json export

1.6.0 (2025-01-29)

  • Drop support for Python 3.7 and 3.8.

  • Add support for Python 3.12 and 3.13.

1.5.3 (2024-11-11)

  • Added check whether outlet code exists in connection nodes.

1.5.2 (2024-03-21)

  • Build the release with the build package instead of setuptools.

  • Rewrite release workflow to use a supported github action for github release.

  • Updated required threedi-schema version to 0.219.*

1.5.1 (2023-05-17)

  • Updated required threedi-schema version to 0.217.*

1.5.0 (2023-04-12)

  • Extra release to signal updated requirements.

1.4.5 (2023-03-31)

  • Make exporter work with SQLAlchemy 2.*

  • Updated required threedi-schema version to 0.216.*

1.4.4 (2023-02-20)

  • Fix error for missing “VerloopVolume” (VER_VOL).

1.4.3 (2023-02-01)

  • Fixed packaging (hydxlib was not listed as package in setup).

1.4.2 (2023-02-01)

  • Updated required threedi-schema version to 0.214.*

1.4.1 (2023-01-31)

  • Updated strictly required threedi-schema version to 0.214.3

1.4 (2023-01-27)

  • Added threedi-schema as a dependency, removing threedi-modelchecker

  • Fixed writing logging to file

1.3 (2022-12-12)

  • Fixed all tabulated profiles (TAB, HEU, MVR, UVR, OVA) and added TPZ and YZP.

  • Added inverted egg (EIG) profile.

  • Added trapezium profile in case no tabulated profile is given.

  • Add all cross sections to the 3Di spatialite and use the identifications from the input file.

  • Check if a profile is open/closed depending on the verbinding type (OPL or not).

1.2 (2022-12-06)

  • Added Heul (HEU), U-Vorm (UVR), Ovaal (OVA) profielen, fixed Muil (MVR), removed trapezium (TPZ).

  • Fixed empty connection_node.the_geom column.

1.1 (2022-11-09)

  • Log through the hydxlib.* logger instead of the root logger.

  • Emit error log if a value is required according to GWSW, but missing.

  • Made log messages more comprehensible by using terminology from GWSW instead of internal model and field names.

  • Set KNP_MAT to not required.

  • Emit more comprehensible error if a verbinding with types GSL, OPL, ITR, or DRL has no profile.

1.0 (2022-10-25)

  • Backport changes from https://github.com/threedi/beta-plugins.

  • Added threedi-modelchecker as a dependency, and used the 3Di schema in it as a replacement for hydxlib.sql_models.

  • Removed PostGRES support (only spatialite remains).

  • Replaced GDAL with pyproj.

  • An ‘RHK’ profile is now interpreted as a closed (instead of open) rectangle.

  • Add JSON export format.

0.7 (2020-03-03)

  • Closing database connection

  • Updating bug in rectangular cross sections

0.6 (2019-11-22)

  • Using the final version of the hydx format.

0.5 (2019-02-12)

  • Bug fix discharge coefficient orifices in Threedi.

0.4 (2019-01-18)

  • Small fixes.

0.3 (2019-01-09)

  • Added docstrings and updated the readme.

0.2 (2019-01-09)

  • Enabled automatic pypi.org uploads from travis-ci.com

0.1 (2019-01-09)

Metadata

Release files for hydxlib 1.8.0

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

Source distribution (sdist)

Source distribution for hydxlib 1.8.0
File Size Uploaded Provenance Actions
hydxlib-1.8.0.tar.gz 30.5 kB Without provenance Details for hydxlib-1.8.0.tar.gz

Built distribution (wheel)

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

Total release size: 61.3 kB

Release files / hydxlib-1.8.0.tar.gz

Download URL hydxlib-1.8.0.tar.gz
Size 30.5 kB
Tags Source
SHA-256 checksum
How to use checksums
735ab1767a6cd5c4dd2e5d419f6a728d5472d312fabb87bc0897f5b961004d09
BLAKE2b-256 checksum
How to use checksums
ce80ede964f6270f64cc8938afdb40ceb013098577a2668f9fd56ec34bd37c7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hydxlib-1.8.0-py3-none-any.whl

Download URL hydxlib-1.8.0-py3-none-any.whl
Size 30.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f527465dbd6949267bd1fb8416d835f44e36f40c4282f3b558422f3c443008d8
BLAKE2b-256 checksum
How to use checksums
39f204fabd902097da7faad550e47991e93aeca3a7f0bc4ba8dc773488cb2188
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for hydxlib 1.8.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.8.0 This release

2 release files No provenance

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