Skip to main content

tide-prediction

Tidal prediction library for French Atlantic and English Channel ports. Computes high/low water times, heights, tidal coefficients, and full height curves — all from a fast Rust core exposed via Python bindings.

Disclaimer

This library is provided AS IS, without warranty of any kind. It is not intended for navigation, maritime safety, or any use where inaccurate predictions could cause harm to persons, property, or the environment. Predictions are produced from a simplified 13-constituent harmonic model and do not account for meteorological effects (storm surge, wind, barometric pressure) or exceptional astronomical events. Typical residual RMSE is 0.10–0.25 m; local error may be larger.

For official tidal predictions in France, refer to the SHOM. The author disclaims all liability arising from the use of this software. By using this library you do so at your own risk and sole responsibility.

Installation

pip install tide-prediction

The package is imported as import tide (not tide_prediction).

Quick start

import tide

# Predict a full day
pred = tide.predict_day("FR-BREST", "2024-06-15")

from datetime import datetime, timezone

for e in pred.extremes:
    kind = "HW" if e.is_high_water else "LW"
    coef = f"  coef={e.coefficient}" if e.coefficient else ""
    dt = datetime.fromtimestamp(e.time, tz=timezone.utc).strftime("%H:%M")
    print(f"{kind}  {dt}  {e.height:.2f} m{coef}")

# HW  00:26  4.83 m  coef=39
# LW  06:41  2.40 m
# HW  13:07  4.80 m  coef=42
# LW  19:07  2.61 m

API

tide.predict_day(port_id, date) → DayPrediction

Returns high/low water extremes and a 10-minute height curve for a single day.

  • port_id — port identifier (e.g. "FR-BREST")
  • date — date string "YYYY-MM-DD" (UTC)

tide.predict_range(port_id, from_date, to_date) → list[DayPrediction]

Same as predict_day over a date range (inclusive).

tide.height_at(port_id, timestamp) → float

Instantaneous water height in metres at a given Unix UTC timestamp.

from datetime import datetime, timezone

ts = int(datetime(2024, 6, 15, 12, 0, tzinfo=timezone.utc).timestamp())
h = tide.height_at("FR-BREST", ts)
print(f"{h:.3f} m")  # 4.607 m

Port discovery

# List all available ports
ports = tide.list_ports()

# Search by name
results = tide.search_ports("saint")

# Get a specific port
port = tide.get_port("FR-BREST")
print(port.name, port.latitude, port.longitude)

Data model

DayPrediction
├── port_id        str
├── date           str          "YYYY-MM-DD"
├── extremes       list[TidalExtreme]
│   ├── time           int      Unix timestamp UTC
│   ├── height         float    metres
│   ├── is_high_water  bool
│   └── coefficient    int|None 20–120, Atlantic/Channel HW only
└── heights        list[HeightPoint]
    ├── timestamp   int          every 10 minutes
    └── height      float        metres

Available ports

ID Port Calibration
FR-BREST Brest (coefficient reference) REFMAR 5 yr
FR-PORT-TUDY Port Tudy (Île de Groix) REFMAR 5 yr
FR-CONCARNEAU Concarneau REFMAR 5 yr
FR-SAINT-NAZAIRE Saint-Nazaire REFMAR 5 yr
FR-LA-ROCHELLE La Rochelle — La Pallice REFMAR 5 yr
FR-ROSCOFF Roscoff REFMAR 5 yr
FR-SAINT-MALO Saint-Malo REFMAR 5 yr
FR-CHERBOURG Cherbourg REFMAR 5 yr
FR-LE-HAVRE Le Havre REFMAR 5 yr
FR-DIEPPE Dieppe REFMAR 5 yr
FR-DUNKERQUE Dunkerque REFMAR 5 yr
FR-BAYONNE Boucau-Bayonne REFMAR 5 yr
FR-ARCACHON Arcachon REFMAR 5 yr
FR-PORT-NAVALO Port-Navalo (Golfe du Morbihan) SHOM SPM 3 yr
FR-ARRADON Arradon (Golfe du Morbihan) SHOM SPM 3 yr
FR-AURAY Auray — Saint-Goustan SHOM SPM 3 yr
FR-ETEL Entrée rivière d'Étel SHOM SPM 3 yr

Tidal coefficients

Coefficients (20–120) are computed for Atlantic and English Channel high waters relative to the Brest reference tidal range, following the French SHOM convention. They are only available for high water (is_high_water = True) at ports on the Atlantic/Channel coast.

Requirements

  • Python ≥ 3.8
  • Currently tested on Linux x86-64 (manylinux). macOS and Windows wheels may be added in future releases.

Metadata

Release files for tide-prediction 1.2.2

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

Built distributions (wheels)

Table of built distributions (wheels) for tide-prediction 1.2.2
File Interpreter ABI Platform Actions
tide_prediction-1.2.2-py3-none-musllinux_1_2_aarch64.whl Python 3 none Linux musl 1.2+ ARM64 Details for tide_prediction-1.2.2-py3-none-musllinux_1_2_aarch64.whl
tide_prediction-1.2.2-py3-none-manylinux_2_34_x86_64.whl Python 3 none Linux glibc 2.34+ x86-64 Details for tide_prediction-1.2.2-py3-none-manylinux_2_34_x86_64.whl
tide_prediction-1.2.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for tide_prediction-1.2.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Total release size: 1.1 MB

Release files / tide_prediction-1.2.2-py3-none-musllinux_1_2_aarch64.whl

Download URL tide_prediction-1.2.2-py3-none-musllinux_1_2_aarch64.whl
Size 347.9 kB
Tags Linux musl 1.2+ ARM64 Python 3
SHA-256 checksum
How to use checksums
14b67b68ef6be8f6475ec9af11eb35696f0ff0334beb1e3ff7014d4a8ca508d1
BLAKE2b-256 checksum
How to use checksums
c5ac43c41194526575ef1a1f2e909c41a62c190dd5571eb09abd80cc81ae828f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / tide_prediction-1.2.2-py3-none-manylinux_2_34_x86_64.whl

Download URL tide_prediction-1.2.2-py3-none-manylinux_2_34_x86_64.whl
Size 394.9 kB
Tags Linux glibc 2.34+ x86-64 Python 3
SHA-256 checksum
How to use checksums
4e1ba3948c4b4f18a398b517bc7f894c1b88f6ce3b73dcf72c3d47c464fc2ed3
BLAKE2b-256 checksum
How to use checksums
2849fc23b248e3893e2a5c21e19fbeef6e78ad0dbbe6be2f047350c41807cf31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / tide_prediction-1.2.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL tide_prediction-1.2.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 349.1 kB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
a4b559a36706c978e744fa13fc2dc9c6cc9923d93c17fe866fc19dd443136182
BLAKE2b-256 checksum
How to use checksums
698538522fbcf85142cda4412f2166a8167b4240cccae60c82c4af33656e04fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for tide-prediction 1.2.2

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.

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