XBGEARS
A collection of Python tools for converting between XBeach grid files (x.grd / y.grd / *.dep) and simple XYZ point files.
Installation
pip install xbgears
Features
- xb2xyz: Convert XBeach x.grd / y.grd / *.dep grid files into a *.xyz point file
- xyz2xb: Convert a *.xyz point file back into x.grd / y.grd / bed.dep files
- xb2yz: Convert a 1D XBeach x.grd / *.dep profile into a two-column *.yz file
- yz2xb: Convert a two-column *.yz profile file back into 1D x.grd / bed.dep files
Usage
Command-line
# List all available commands
xbgears-info
# Convert XBeach grid files to a *.xyz point file
xb2xyz --dep bed.dep --xgrd x.grd --ygrd y.grd --out 001.xyz
# Convert a *.xyz point file back to XBeach grid files
xyz2xb --xyz 001.xyz --outdir XBGRID
# Convert a 1D XBeach profile to a two-column *.yz file
xb2yz --dep bed.dep --xgrd x.grd --out bathy.yz
# Convert a *.yz profile back to 1D XBeach grid files
yz2xb --yz bathy.yz --outdir XBGRID
Python API
from xbgears import xb2xyz, xyz2xb, xb2yz, yz2xb
# Convert XBeach grid files to a *.xyz point file (written to XYZ/001.xyz)
xb2xyz.xb_to_xyz(dep="bed.dep", xgrd="x.grd", ygrd="y.grd", out="001.xyz")
# Convert a *.xyz point file back to XBeach grid files (written to XBGRID/)
xyz2xb.xyz_to_xb(xyz="001.xyz", outdir="XBGRID")
# Convert a 1D XBeach profile to a *.yz file (written to YZ/bathy.yz)
xb2yz.xb_to_yz(dep="bed.dep", xgrd="x.grd", out="bathy.yz")
# Convert a *.yz profile back to 1D XBeach grid files (written to XBGRID/)
yz2xb.yz_to_xb(yz="bathy.yz", outdir="XBGRID")
Notes
xb2xyzreadsxori/yorifromparams.txtin the working directory (if present) and adds them to the x/y coordinates; grid rotation (alfa) is not applied.xb2xyzwrites its output to theXYZ/directory by default;xyz2xbwrites its output to theXBGRID/directory by default.xb2yzwrites its output to theYZ/directory by default;yz2xbwrites toXBGRID/and requires strictly increasing x values. Both use 3-decimal (%.3f) formatting.
Metadata
Release files for xbgears 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| xbgears-0.2.0.tar.gz | 7.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xbgears-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.1 kB
Release files / xbgears-0.2.0.tar.gz
| Download URL | xbgears-0.2.0.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
599f366f31f1ba63faf1a0886980157dac6debb4e78a951f32aabce839248aea
|
|
BLAKE2b-256 checksum How to use checksums |
0113ed2471decf4148e9ceec457a164fbd56bd5c608803f69ab9eb7d437cf4f7
|
| 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 26, 2026.
Transparency logRelease files / xbgears-0.2.0-py3-none-any.whl
| Download URL | xbgears-0.2.0-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
52edae9f93c74e1c4e63729809813cb0bcf1d53617f463b672743370b4b67e21
|
|
BLAKE2b-256 checksum How to use checksums |
a437f398fee196a67831639e5620ad09222216cb204aec2c9c9b4974e43bd545
|
| 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 26, 2026.
Transparency log