Skip to main content

nzmetservice - A Python package for handling New Zealand MetService forecast data

The nzmetservice package contains various functions for downloading, processing, and handling of New Zealand MetService forecast data. This package is not associated with the MetService.

Installation

nzmetservice can be installed via pip or conda:

pip install nzmetservice

or:

conda install -c mullenkamp nzmetservice

The core dependencies are Pandas and xarray.

Usage

ftp_transfer

The ftp_transfer functions does as the name implies. It looks at the output_path on your local drive then compares it to the MetService ftp site and downloads what is on the ftp site that isn’t in the output_path. It can be loaded in from the basic module:

from nzmetservice import ftp_transfer

And feed it with the necessary parameters:

ftp_transfer(ftp_path, username, password, output_path)

You will likely want to create a scheduled task to run a script containing this function once an hour.

Selection and processing

The other two functions are simple selection and conversion tools.

import pandas as pd
from nzmetservice import select_bounds, to_df, datasets

pd.options.display.max_columns = 10

#####################################
### Parameters

min_lat = -47
max_lat = -40
min_lon = 166
max_lon = 175
nc1_path = datasets.get_path('wrf_hourly_precip_nz8km_test')

####################################
### Examples

ms1 = select_bounds(nc1_path, min_lat, max_lat, min_lon, max_lon)

ms_df = to_df(ms1, to_rate=True)

Metadata

Release files for nzmetservice 1.0.3

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

Source distribution (sdist)

Source distribution for nzmetservice 1.0.3
File Size Uploaded Provenance
nzmetservice-1.0.3.tar.gz 1.9 MB Without provenance Details

Release files / nzmetservice-1.0.3.tar.gz

Download URL nzmetservice-1.0.3.tar.gz
Size 1.9 MB
Tags Source
SHA-256 checksum
How to use checksums
f36f09c6220edcf86b3da200ccdb22e4fca3e87f82d0ca7973b7dda792c9704d
BLAKE2b-256 checksum
How to use checksums
9a2a2b22e5e905ac321c82d7a8d67947f65e6620db7e3f1246b6a056f70c0c1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.6

Security for nzmetservice 1.0.3

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