Zig library to read and write dive plans in UDDF format
Note
As with most things built in 2026, OpenWater's code was generated with AI tools under close human supervision.
const std = @import("std");
const openwater = @import("openwater");
const input = // ... UDDF XML bytes ...
var out = std.Io.Writer.Allocating.init(allocator);
defer out.deinit();
try openwater.convert(allocator, .uddf_xml, input, .dive_json_v1, &out.writer);openwater --input plan.uddf.xml --output dive.jsonThe CLI calls the library. The library is the engine. The library can also be used in other external Zig packages.
Input and output formats are chosen from the file extensions (.uddf, .xml, .json). Vendor dive dumps (.dlf, .bin, .raw) require --family (and optionally --model), parsed via libdivecomputer:
openwater --input dive.dlf --output dive.uddf --family freedomI like to learn by working on real projects. I'm using my passion for diving to learn a new programming language.
Requires Zig 0.17.0. With Nix, the flake dev shell pins the same compiler as CI. Dependencies fetch from build.zig.zon when you build inside the shell.
nix flake check
nix develop -c zig fmt --check build.zig build.zig.zon src
nix develop -c zig build test
nix develop -c zig build run -- --input plan.uddf.xml --output dive.jsonWithout Nix:
zig build test
zig build run -- --input plan.uddf.xml --output dive.json