{"id":22045232,"url":"https://github.com/nigelhorne/weather-meteo","last_synced_at":"2025-03-23T14:15:41.540Z","repository":{"id":148208717,"uuid":"607709369","full_name":"nigelhorne/Weather-Meteo","owner":"nigelhorne","description":"Interface to open-meteo.com for historical weather data","archived":false,"fork":false,"pushed_at":"2025-02-24T13:01:27.000Z","size":117,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-24T13:37:01.349Z","etag":null,"topics":["cpan-module","perl","weather"],"latest_commit_sha":null,"homepage":"https://open-meteo.com/","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nigelhorne.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-28T14:22:35.000Z","updated_at":"2025-02-24T13:01:32.000Z","dependencies_parsed_at":"2024-01-13T16:50:28.830Z","dependency_job_id":"3f810ae9-f0f6-4c2a-97d5-b658416d33cd","html_url":"https://github.com/nigelhorne/Weather-Meteo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nigelhorne%2FWeather-Meteo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nigelhorne%2FWeather-Meteo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nigelhorne%2FWeather-Meteo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nigelhorne%2FWeather-Meteo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nigelhorne","download_url":"https://codeload.github.com/nigelhorne/Weather-Meteo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245111946,"owners_count":20562512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpan-module","perl","weather"],"created_at":"2024-11-30T13:12:21.084Z","updated_at":"2025-03-23T14:15:41.512Z","avatar_url":"https://github.com/nigelhorne.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nWeather::Meteo - Interface to [https://open-meteo.com](https://open-meteo.com) for historical weather data\n\n# VERSION\n\nVersion 0.12\n\n# SYNOPSIS\n\nThe `Weather::Meteo` module provides an interface to the Open-Meteo API for retrieving historical weather data from 1940.\nIt allows users to fetch weather information by specifying latitude, longitude, and a date.\nThe module supports object-oriented usage and allows customization of the HTTP user agent.\n\n      use Weather::Meteo;\n\n      my $meteo = Weather::Meteo-\u003enew();\n      my $weather = $meteo-\u003eweather({ latitude =\u003e 0.1, longitude =\u003e 0.2, date =\u003e '2022-12-25' });\n\n- Caching\n\n    Identical requests are cached (using [CHI](https://metacpan.org/pod/CHI) or a user-supplied caching object),\n    reducing the number of HTTP requests to the API and speeding up repeated queries.\n\n    This module leverages [CHI](https://metacpan.org/pod/CHI) for caching geocoding responses.\n    When a geocode request is made,\n    a cache key is constructed from the request.\n    If a cached response exists,\n    it is returned immediately,\n    avoiding unnecessary API calls.\n\n- Rate-Limiting\n\n    A minimum interval between successive API calls can be enforced to ensure that the API is not overwhelmed and to comply with any request throttling requirements.\n\n    Rate-limiting is implemented using [Time::HiRes](https://metacpan.org/pod/Time%3A%3AHiRes).\n    A minimum interval between API\n    calls can be specified via the `min_interval` parameter in the constructor.\n    Before making an API call,\n    the module checks how much time has elapsed since the\n    last request and,\n    if necessary,\n    sleeps for the remaining time.\n\n# METHODS\n\n## new\n\n    my $meteo = Weather::Meteo-\u003enew();\n    my $ua = LWP::UserAgent-\u003enew();\n    $ua-\u003eenv_proxy(1);\n    $meteo = Weather::Meteo-\u003enew(ua =\u003e $ua);\n\n    my $weather = $meteo-\u003eweather({ latitude =\u003e 51.34, longitude =\u003e 1.42, date =\u003e '2022-12-25' });\n    my @snowfall = @{$weather-\u003e{'hourly'}-\u003e{'snowfall'}};\n\n    print 'Number of cms of snow: ', $snowfall[1], \"\\n\";\n\nCreates a new instance. Acceptable options include:\n\n- `cache`\n\n    A caching object.\n    If not provided,\n    an in-memory cache is created with a default expiration of one hour.\n\n- `host`\n\n    The API host endpoint.\n    Defaults to [https://archive-api.open-meteo.com](https://archive-api.open-meteo.com).\n\n- `min_interval`\n\n    Minimum number of seconds to wait between API requests.\n    Defaults to `0` (no delay).\n    Use this option to enforce rate-limiting.\n\n- `ua`\n\n    An object to use for HTTP requests.\n    If not provided, a default user agent is created.\n\n## weather\n\n    use Geo::Location::Point;\n\n    my $ramsgate = Geo::Location::Point-\u003enew({ latitude =\u003e 51.34, longitude =\u003e 1.42 });\n    # Print snowfall at 1AM on Christmas morning in Ramsgate\n    $weather = $meteo-\u003eweather($ramsgate, '2022-12-25');\n    @snowfall = @{$weather-\u003e{'hourly'}-\u003e{'snowfall'}};\n\n    print 'Number of cms of snow: ', $snowfall[1], \"\\n\";\n\n    use DateTime;\n    my $dt = DateTime-\u003enew(year =\u003e 2024, month =\u003e 2, day =\u003e 1);\n    $weather = $meteo-\u003eweather({ location =\u003e $ramsgate, date =\u003e $dt });\n\nThe date argument can be an ISO-8601 formatted date,\nor an object that understands the strftime method.\n\nTakes an optional argument, tz, containing the time zone.\nIf not given, the module tries to work it out from the given location,\nfor that to work set TIMEZONEDB\\_KEY to be your API key from [https://timezonedb.com](https://timezonedb.com).\nIf all else fails, the module falls back to Europe/London.\n\n## ua\n\nAccessor method to get and set UserAgent object used internally. You\ncan call _env\\_proxy_ for example, to get the proxy information from\nenvironment variables:\n\n    $meteo-\u003eua()-\u003eenv_proxy(1);\n\nYou can also set your own User-Agent object:\n\n    use LWP::UserAgent::Throttled;\n\n    my $ua = LWP::UserAgent::Throttled-\u003enew();\n    $ua-\u003ethrottle('open-meteo.com' =\u003e 1);\n    $meteo-\u003eua($ua);\n\n# AUTHOR\n\nNigel Horne, `\u003cnjh@bandsman.co.uk\u003e`\n\nThis library is free software; you can redistribute it and/or modify\nit under the same terms as Perl itself.\n\nLots of thanks to the folks at [https://open-meteo.com](https://open-meteo.com).\n\n# BUGS\n\nThis module is provided as-is without any warranty.\n\nPlease report any bugs or feature requests to `bug-weather-meteo at rt.cpan.org`,\nor through the web interface at\n[http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Weather-Meteo](http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Weather-Meteo).\nI will be notified, and then you'll\nautomatically be notified of progress on your bug as I make changes.\n\n# SEE ALSO\n\nOpen Meteo API: [https://open-meteo.com/en/docs#api\\_form](https://open-meteo.com/en/docs#api_form)\n\n# SUPPORT\n\nYou can find documentation for this module with the perldoc command.\n\n    perldoc Weather::Meteo\n\nYou can also look for information at:\n\n- MetaCPAN\n\n    [https://metacpan.org/release/Weather-Meteo](https://metacpan.org/release/Weather-Meteo)\n\n- RT: CPAN's request tracker\n\n    [https://rt.cpan.org/NoAuth/Bugs.html?Dist=Weather-Meteo](https://rt.cpan.org/NoAuth/Bugs.html?Dist=Weather-Meteo)\n\n- CPANTS\n\n    [http://cpants.cpanauthors.org/dist/Weather-Meteo](http://cpants.cpanauthors.org/dist/Weather-Meteo)\n\n- CPAN Testers' Matrix\n\n    [http://matrix.cpantesters.org/?dist=Weather-Meteo](http://matrix.cpantesters.org/?dist=Weather-Meteo)\n\n- CPAN Testers Dependencies\n\n    [http://deps.cpantesters.org/?module=Weather-Meteo](http://deps.cpantesters.org/?module=Weather-Meteo)\n\n# LICENSE AND COPYRIGHT\n\nCopyright 2023-2025 Nigel Horne.\n\nThis program is released under the following licence: GPL2\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnigelhorne%2Fweather-meteo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnigelhorne%2Fweather-meteo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnigelhorne%2Fweather-meteo/lists"}