Skip to main content

marinerg-data

marinerg-data is the command-line client for the MARINERG-i data catalogue. A test facility uses it to turn instrument exports into standard NetCDF, check them, and publish them. A researcher uses it to find and download what has been published.

How it fits together

Data files never pass through MARINERG-i. A facility deposits its files in its own Zenodo account, which gives the dataset a DOI. This tool then registers the dataset in the MARINERG-i catalogue, and fills in the record from the files. The catalogue's own docs explain how the catalogue works.

Facilities differ in how organised their data is. The tool works at every level:

Level The facility has It can
0 Files and a test report Add a catalogue record by hand, with a contact for the data
1 Run logs and vendor exports Describe its exports with templates, then convert them
2 Consistent formats and instrument lists Convert, validate and publish each campaign
3 Standard formats such as CF NetCDF Validate and publish directly

Install

pip install "marinerg-data[convert,kerchunk]"   # to convert and publish
pip install "marinerg-data[vre]"                # to use data in a VRE

[convert] reads exports and writes NetCDF. [kerchunk] adds a small index beside each NetCDF, so a VRE can stream part of a file from Zenodo. Without either, the client still validates and publishes files that are already converted.

Publish your data

Publishing takes four commands. Each one says what to run next.

  1. Inspect. marinerg-data inspect <folder> says which equipment template matches each export. A template describes how one instrument writes its files: the delimiter, the decimal separator, the units, and which column is time. If nothing matches, write a template first, as Templates explains.

  2. Convert. marinerg-data convert <folder> reads each export through its template and writes a NetCDF file and a run manifest, which describes the run. It stops, naming the column and row, at anything the template does not settle, such as a unit the file and the template disagree on.

    For a test campaign with several instruments, keep a folder per instrument and convert them together with --campaign. Each run then gets one manifest over every instrument, with each clock's offset applied. It also drafts dataset.yaml, the metadata for the catalogue record. Read it and edit it: the tool never overwrites it.

  3. Validate. marinerg-data validate <folder> checks the manifests and dataset.yaml against the vocabularies the catalogue uses, so a mistake is caught before anything is uploaded.

  4. Publish. Set ZENODO_TOKEN to your Zenodo token, CKAN_URL to the catalogue's address and CKAN_TOKEN to your catalogue API token. Then run marinerg-data publish <folder> --sandbox to try it on sandbox.zenodo.org, and drop --sandbox when it looks right. --new-version publishes a correction as a new version of the same record.

If a publish fails part-way, run the same command again. It carries on from where it stopped, and never mints a second DOI for the same data.

Try it without data

demo/ walks the publish path with generated data, so you can see every step before using your own files.

Use published data

marinerg-data fetch <doi-or-name> --cache <folder> downloads a dataset into a shared cache, so a lab downloads each file once. A name, rather than a DOI, is looked up in the catalogue at CKAN_URL.

marinerg-data catalog writes an intake catalogue of the published datasets, for opening them in Python. examples/ shows both in Jupyter and in a Virtual Research Environment.

Templates

The package ships equipment templates for common instruments; marinerg-data template list shows them. For an instrument without one:

  1. marinerg-data template draft <export> guesses a template from a sample file and writes it beside the file. The guesses are only a start: check every value, and replace each TODO. The template will not load until you have. Each channel names what it measures with a parameter code; marinerg-data template parameters lists them.
  2. marinerg-data template check <template-file> <export> reads the export through it and reports what it mapped and what it could not.
  3. Keep your templates in a folder, and pass it to every command with --templates <folder>. Templates in your user config folder are loaded too (~/.config/marinerg-data/templates on Linux).

A campaign also needs a facility template, with the facility's name, ROR and default licence, and a campaign template, listing the instruments and naming the operator's log. Keep them in facilities/ and campaigns/ inside your templates folder. The fixtures in tests/fixtures/templates are worked examples of all three kinds.

Develop

uv sync --group dev
uv run pytest
uv run ruff check src tests

marinerg-data dev generates test and demo data. It is left out of --help; marinerg-data dev --help lists what it does.

Licence

Copyright Irish Centre for High End Computing - 2026. MIT — see LICENSE.

Metadata

Release files for marinerg-data 0.4.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 marinerg-data 0.4.0
File Size Uploaded
marinerg_data-0.4.0.tar.gz 122.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for marinerg-data 0.4.0
File Interpreter ABI Platform
marinerg_data-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 224.5 kB

Release files / marinerg_data-0.4.0.tar.gz

Download URL marinerg_data-0.4.0.tar.gz
Size 122.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b7d7fe76004c129fba4b5bd4bd1c5d17ee796a19325bbb8d49a44068e41cfde4
BLAKE2b-256 checksum
How to use checksums
3e2a6b4b69c28c06ced3341e5933499897e822b8832be217ee98ac648782cb7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / marinerg_data-0.4.0-py3-none-any.whl

Download URL marinerg_data-0.4.0-py3-none-any.whl
Size 101.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d80d34ec51c2b9ba0350bdaef7583dd5f0870c6b8b51c35849cfaaa840f69dec
BLAKE2b-256 checksum
How to use checksums
71a8837f06fc24b6503d3e12d6124b0d496118df4ebd2201bc205e17b1292ba1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

0.6.0

2 release files

0.5.0

2 release files

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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