Skip to main content

A custom HURDAT2 data parser.

Project description

hurdat2py

PyPI version License: MIT Python 3.7+

hurdat2py is a research-focused Python interface for the NOAA HURDAT2 Dataset. It automates data retrieval and parsing, giving you immediate access to clean, analysis-ready data.

  • Note: Currently only the North Atlantic Basin is supported. See Roadmap for more info.

Table of Contents

  1. Installation
  2. Quick Start
  3. API Reference
  4. Roadmap
  5. Changelog
  6. Attribution

Installation

pip install hurdat2py

Quick Start

1. Initialize the Database

  • You can specify a path to a local download of the Hurdat2 dataset.
import hurdat2py

hd2 = hurdat2py.Hurdat2("path_to_file.txt")
  • Or if no path is specified, it will automatically download the latest data from https://www.nhc.noaa.gov/data/hurdat/ (~7MB) and save it locally.
    • Note: The cached file will be overwritten after 30 days to ensure the latest file is available.
import hurdat2py

hd2 = hurdat2py.Hurdat2()

2. Create Storm or Season objects

  • Allows for easy access to storm or season data.
# Storm obect:
storm = hd2['bob', 1991]
# or
storm = hd2['al031991']

# Season object:
season = hd2[1991]

API Reference

1. The Database (Hurdat2)

The main entry point. Handles downloading, caching, and parsing the raw text data.

Method Description Example
hurdat2py.Hurdat2() Initializes the database. Downloads latest data if local cache is missing/expired. hd2 = hurdat2py.Hurdat2()
db['name', year] Get Storm (by Name)*. Returns a Storm object. Case-insensitive.

*This method will not work for storms named UNNAMED, especially before 1950.
storm = hd2['bob', 1991]
db[atcfid] Get Storm (by ID). Returns a Storm object using ATCFID. storm = hd2['al031991']
db[year] Get Season. Returns a Season object for the specified year. season = hd2[1991]
rank_seasons_by_ace() Returns a sorted list of seasons by Accumulated Cyclone Energy. top5 = hd2.rank_seasons_by_ace()[:5]

2. The Storm Object

Represents a single tropical cyclone.

Method/Attribute Description Example
name Operational name (e.g., "Bob") (str). print(storm.name)
atcfid ATCF ID (e.g., "AL031991") (str). print(storm.atcfid)
year The year the storm formed (int). print(storm.year)
ace Accumulated Cyclone Energy (10^-4 kn^2) (float). print(storm.ace)
peak_wind Maximum sustained wind speed (knots) (int). print(storm.peak_wind)
peak_status Highest tropical classification the storm achieved (MH, HU, TS, SS, TD, SD) (str). print(storm.peak_status)
min_pressure Minimum central pressure (mb) (int). print(storm.min_pressure)
landfalls Number of landfalls recorded* (int).

*Note: not every landfall is recorded in the Hurdat2 dataset.
print(storm.landfalls)
lats/lons Raw list of latitude/longitude points. ax.plot(storm.lons, storm.lats)
duration_total
duration_tc
duration_ts
duration_hurricane
duration_major
Duration of the system in hours, while at specified status (float) print(storm.duration_tc)
distance_total
distance_tc
distance_ts
distance_hurricane
distance_major
Distance* the system travelled in Nautical Miles, while at specified status (float)

*Note: Distances calculated using the Haversine Formula.
print(storm.distance_major)
info() Prints quick overview of the storm. storm.info()
stats() Prints statistics and detailed information about the storm. storm.stats()
plot() Plots storm track, colored by Saffir-Simpson intensity. Plot aesthetic is inspired by the tropycal package. storm.plot()
plot_intensity() Plots the storm's windspeed over time, colored by Saffir-Simpson intensity.
Kwargs:
zoom (bool) Crops into the intensity curve.
landfalls (bool) Plots landfall times on intensity curve.
storm.plot_intensity(zoom=True, landfalls=False)
to_dataframe() Exports track data (date, time, lat, lon, wind, pressure) to a Pandas DataFrame. df = storm.to_dataframe()

3. The Season Object

Represents a full year of activity.

Method/Attribute Description Example
year Returns the year of the season (int) print(season.year)
storms List of Storm objects within the season. print(season.storms)
total_storms Number of storms in the season. Effectively len(season.storms) print(season_total_storms)
tropical_storms Number of tropical storms in the season. print(season.tropical_storms)
hurricanes Number of hurricanes in the season. print(season.hurricanes)
major_hurricanes Number of major hurricanes in the season. print(season.major_hurricanes)
ace Total Accumulated Cyclone Energy for the season (float). print(season.ace)
stats() Prints statistics and detailed information about the season. season.stats()
plot() Plots all storm tracks for the season, colored by Saffir-Simpson intensity. Plot aesthetic is inspired by the tropycal package.
Kwargs:
labels (bool) Adds labels for each storm track.
season.plot(labels=True)
to_dataframe() Exports track data (date, time, lat, lon, wind, pressure) for all storms in the season to a Pandas DataFrame. df = season.to_dataframe()

Roadmap

Future planned updates:

  • Northeast Pacific Support: Add support for the NEPAC Hurdat2 dataset.
    • Expected: Spring 2026
  • Statistics Improvements: Implement new statistics functionality for Storm and Season objects.
    • Expected: Summer 2026
  • Improved Plotting Functionality: Add/improve plotting functions.
    • Expected: Summer 2026
  • Wind Radius Implementation: Add support for and methods utilizing wind radius data included with modern records in the Hurdat2 dataset.
    • Expected: 2027

Changelog

v0.3.3 (2026-01-15)

  • Documentation: Major overhaul of README to include API reference tables and additional information.

v0.3.2 (2026-01-13)

  • Documentation: Updates to README.

v0.3.1 (2026-01-13)

  • Launch: Initial release on PyPI.
  • Structure: Package structure overhaul for organization.

Attribution & Data Sources

Data

  • This package processes data from the National Hurricane Center (NHC) HURDAT2 Database.
    • Landsea, C. W. and J. L. Franklin, 2013: Atlantic Hurricane Database Uncertainty and Presentation of a New Database Format. Mon. Wea. Rev., 141, 3576-3592.

Acknowledgements

  • Inspiration: This work was inspired by the great hurdat2parser package. There are many technical capabilities of hurdat2parser that we do not seek to replicate. We recommend you choose whichever package best suites your needs.

  • Plotting Style: The map visualization aesthetic in this package was inspired by the excellent tropycal package. While hurdat2py is a standalone implementation, we aimed to match their clear, publication-ready visual style.

License

MIT License. See LICENSE file for details.

Disclaimer

This package is maintained for personal research and is not an official NOAA product.

Copyright

hurdat2py
Copyright © 2026 Andy McKeen
License: MIT

Project details


Download files

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

Source Distribution

hurdat2py-0.3.3.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

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

hurdat2py-0.3.3-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file hurdat2py-0.3.3.tar.gz.

File metadata

  • Download URL: hurdat2py-0.3.3.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.8

File hashes

Hashes for hurdat2py-0.3.3.tar.gz
Algorithm Hash digest
SHA256 fe87e13e39a094024a08b93f82e6f31d30327e9e84018db30e54af3ebca9a035
MD5 43121b4a6a8ba9d1dcbc87a83a46a6df
BLAKE2b-256 2f10fa12f18c1c6f9341c395cb539610ede48dfae08863a1bacc3b989e4a260f

See more details on using hashes here.

File details

Details for the file hurdat2py-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: hurdat2py-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.8

File hashes

Hashes for hurdat2py-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f6f65cca84b4ae5bb912fc68ba5543d823e0d63706ce0b3086312f9fac128fcd
MD5 60b8706a6b475b6c2f522bdaa49b0422
BLAKE2b-256 3fb604c9db44f5c7f99d5b6db1824793ae3ad8b0cf01d3b12c3a9371bad15fe0

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