Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Perl object to access historic Canadian weather details

Quick Perl usage (

use weatherDataFromEnvironmentCanada;

my $weatherDataOBJ = weatherDataFromEnvironmentCanada->new(
        'weatherStationID' => '5051',
        'weatherDate' => '1944-12-11'

if ( $weatherDataOBJ->wasErrors() ) {
        print "Error creating weather object\n";
        print $weatherDataOBJ->errorString();
} else {
      print "Back on December 11th, 1944 the max temperature in Toronto was ";
      print $weatherDataOBJ->weatherMeasurementValue("maxTemp") . " ";
	  print $weatherDataOBJ->weatherMeasurementUnits("maxTemp") . "\n\n";
	  print "Summary: " . $weatherDataOBJ->weatherSummary();
	  print "\n\n(Using version " . $weatherDataOBJ->weatherObjectVersion() . " of the object.)";

# Reads the data from:
#    &stationID=5051&Year=1944&Month=12&Day=11
#    &timeframe=2&submit=Download+Data

Data source - Environment Canada historic weather data

We can get historic weather data from the web, like:

Here's the call to download a CSV file with the hourly weather data for all the days in the month specified:

But really we're more interested in the daily high and low, so I think this link is more useful:

Initial inspiration

I run a website that catalogs historic Toronto photos, and realized it would be interesting to add weather details for each of the photos. For instance there are a few photos of all the snow on December 11th, 1944 -

Data to store in our database

Here's the data we can get from the CSV file that we'd like to store in the Wholemap database for later access:

  • Station ID - the stationID parameter
  • historical date
  • date this data was accessed from the Environment Canada website
  • URL used to access the data
  • version of my data access and clean script used
  • Max Temp (°C)
  • Max Temp notes
  • Min Temp (°C)
  • Min Temp notes
  • Total Rain (mm)
  • Total Rain notes
  • Total Snow (cm)
  • Total Snow notes
  • Snow on ground (cm)
  • Snow on ground notes

Related web pages

Here's a detailed blog post on using the bulkdata_e.html call:

Which uses calls like:

And looked useful, too


Perl object to read and parse Environment Canada historic weather data for a given date and location (by StationID). Downloads from their open data feed.



No releases published


No packages published


You can’t perform that action at this time.