Skip to main content

bottomtime

A lossless dive-log store for divers who log with more than one computer.

Tec divers often wear two dive computers (say, a Garmin Descent on one wrist and a Shearwater on the other). Each records the same dive differently: the Garmin logs at 1 Hz with heart rate, GPS, CNS and tissue loading; the Shearwater logs its native record with GF99, deco ceiling, ppO2 sensors and per-sample battery. No existing interchange format (UDDF, DL7, Subsurface) preserves the union, so exporting to any of them throws data away.

bottomtime keeps everything:

  • Ingests Garmin FIT files (official garmin-fit-sdk). Known dive channels become typed columns; unknown fields and Garmin's undocumented message types are preserved raw, per sample and per message.
  • Decodes Shearwater's Petrel Native Format directly from a Shearwater Cloud database (dive_data.db, the "Export Database" output) with a pure Python decoder — including per-sample GF99, deco ceiling, CNS and battery voltage that Shearwater's own XML/CSV exports omit. Unknown record types are preserved raw.
  • Archives every source file verbatim, content-addressed by SHA-256. The database is a decoded view; the archive is the source of truth.
  • Reconciles dual-computer dives: interval overlap plus depth-profile cross-correlation links the two logs of the same physical dive (storing clock offset and residual skew) without ever merging or resampling the original series.
  • Verifies itself: the decoder is cross-checked per-sample against Shearwater XML exports, against Shearwater Cloud's own computed values (EndGF99), and matched dives are checked for depth agreement.

Everything lands in a single SQLite file with a stable schema, ready for SQL, pandas, or whatever you analyze with.

Install

pip install bottomtime

Usage

# create a store
bottomtime init

# ingest a directory of Garmin FIT files
# (optionally with a Garmin Connect index JSON for true UTC offsets and metadata)
bottomtime ingest garmin ~/dives/garmin-fits

# ingest a Shearwater Cloud database export
bottomtime ingest shearwater ~/dives/dive_data.db

# link dual-computer dives and build the canonical dive list
bottomtime match

# run the verification suite (XML dir optional but recommended)
bottomtime verify --xml-dir ~/dives/shearwater-xml

bottomtime status

All commands are idempotent: re-running an ingest skips already-stored dives, so syncing after a dive trip only adds what's new.

Schema in one breath

raw_artifacts (archived files) → source_dives (one row per computer log, with the verbatim header and, for Shearwater, the raw PNF blob) → garmin_samples / shearwater_samples (wide, per-source, never resampled) + gases, gas_segments, events, undecoded_payloads (raw bytes of anything not yet understood) → matches (dual-computer links) → dives + dive_members (canonical dives). Views v_dive_summary and v_samples_unified cover the common queries.

Notes on the PNF decoder

The decoder follows libdivecomputer's shearwater_predator_parser.c for the documented fields and adds empirically verified mappings for GF99 (byte 25), deco ceiling (byte 24), battery voltage (byte 18) and @+5 TTS (bytes 26-27), validated against Shearwater Cloud's displayed values across hundreds of dives. Bytes without a known meaning are preserved per sample. If your dives disagree, bottomtime verify will say so loudly — issue reports with a failing blob are very welcome.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bottomtime-0.1.0.tar.gz (27.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bottomtime-0.1.0-py3-none-any.whl (32.5 kB view details)

Uploaded Python 3

File details

Details for the file bottomtime-0.1.0.tar.gz.

File metadata

  • Download URL: bottomtime-0.1.0.tar.gz
  • Upload date:
  • Size: 27.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for bottomtime-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cd3bff3c26c3f839ef729f7a2997cd147192e555756ca40e5dcb92e52431549c
MD5 9ff8ae16f76ccec9ba53794cd230ecc1
BLAKE2b-256 0be400c2bb39229c5990efc9dc65192955946eea43d4fd3f3035d7ead7103911

See more details on using hashes here.

File details

Details for the file bottomtime-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bottomtime-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 32.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for bottomtime-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7741182c21d6227a1e545b612de1c77b19fc2e40e7fb8e31dcfa9301a6ac392
MD5 f0193ff07d667980654d5d74ec1bd04c
BLAKE2b-256 e2195ac5067af0dcc33504ce3d4fe61864182aee406bfd64802bf97bdf0d8a6c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page