Skip to main content

A custom HURDAT2 data parser.

Project description

hurdat2py logo

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")
  • 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 (float). 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 (int). Effectively len(season.storms) print(season_total_storms)
tropical_storms Number of tropical storms in the season (int). print(season.tropical_storms)
hurricanes Number of hurricanes in the season (int). print(season.hurricanes)
major_hurricanes Number of major hurricanes in the season (int). 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: Summer 2027

Changelog

v0.3.5 (2026-01-22)

  • Documentation: Add logo to README.

v0.3.4 (2026-01-15)

  • Documentation: Minor updates to README.
  • Launch: Initial release on GitHub.

v0.3.3 (2026-01-15)

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

v0.3.2 (2026-01-12)

  • Documentation: Updates to README.

v0.3.1 (2026-01-12)

  • 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

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

Python® and the Python logo are registered trademarks of the Python Software Foundation. hurdat2py is an independent open-source project and is not affiliated with or endorsed by the Python Software Foundation.

Copyright

hurdat2py
Copyright © 2026 Andy McKeen
License: MIT
GitHub: https://github.com/andy-theia/hurdat2py

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.5.tar.gz (19.5 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.5-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hurdat2py-0.3.5.tar.gz
  • Upload date:
  • Size: 19.5 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.5.tar.gz
Algorithm Hash digest
SHA256 e8a8473420e9aef2568cb79a5a93d72fe0a94446ed61827a9fe8b40cb77bf05d
MD5 0d843dcdc37898eab3e32dacf884c1ee
BLAKE2b-256 3bdef87be07313a42a85d1aeec9876c63becaad50a5f4ad0a60416d05535f130

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hurdat2py-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 17.8 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 84678f65087f2babe8cce1f4f7c8fc4ef2e892cec0d5f0f836457bc240ce5636
MD5 ae65d9bf47122a820775db6dd8eed8ff
BLAKE2b-256 f4e37ba9ede6c0e04189120155c3f61b3bf4126703a7f5424747ab09e533cb18

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