Skip to main content

xclim: Climate services library xclim

Versions

Python Package Index Build Conda-forge Build Version Supported Python Versions

Documentation and Support

Documentation Status Static Badge

Open Source

License Open Source Security Foundation Scorecard DOI pyOpenSci JOSS

Coding Standards

Ruff prek mypy pre-commit.ci status Open Source Security Foundation Best Practices FOSSA zizmor

Development Status

Project Status: Active - The project has reached a stable, usable state and is being actively developed. Build Status Coveralls

xclim is an operational Python library for climate services, providing numerous climate-related indicator tools with an extensible framework for constructing custom climate indicators, statistical downscaling and bias adjustment of climate model simulations, as well as climate model ensemble analysis tools.

xclim is built using xarray and can seamlessly benefit from the parallelization handling provided by dask. Its objective is to make it as simple as possible for users to perform typical climate services data treatment workflows. Leveraging xarray and dask, users can easily compute many different climate indicators from large climate datasets.

For example, the following would compute monthly mean temperature from daily mean temperature:

import xclim
import xarray as xr

ds = xr.open_dataset(filename)
tg = xclim.atmos.tg_mean(ds.tas, freq="MS")

For applications where metadata and missing values are important to get right, xclim provides a class for each index that validates inputs, checks for missing values, converts units and assigns metadata attributes to the output. This also provides a mechanism for users to customize these indicators to their own specifications and preferences. xclim currently provides over 150 climate indicators related to mean, minimum and maximum daily temperature, daily precipitation, streamflow and sea ice concentration, as well as a dedicated module for ensemble analysis and a data validation/health-check module.

Quick Install

xclim can be installed from PyPI:

$ pip install xclim

or from Anaconda (conda-forge):

$ conda install -c conda-forge xclim

Documentation

The official documentation is at https://xclim.readthedocs.io/

How to make the most of xclim: Basic Usage Examples and In-Depth Examples.

Conventions

In order to provide a coherent interface, xclim tries to follow different sets of conventions. In particular, input data should follow the CF conventions whenever possible for variable attributes. Variable names are usually the ones used in CMIP6, when they exist.

However, xclim will always assume the temporal coordinate is named “time”. If your data uses another name (for example: “T”), you can rename the variable with:

ds = ds.rename(T="time")

xclim employs a black-compatible code formatting style (via a modified ruff configuration) and (mostly) adheres to the NumPy docstring style. The library is also fully compliant with mypy (ty) for a coherent and consistent static- and duck-typed code base. For more information on coding and development conventions, see the Contributing Guidelines.

Contributing to xclim

xclim is in active development and is being used in production by climate services specialists around the world.

  • If you’re interested in participating in the development of xclim by suggesting new features, new indices or report bugs, please leave us a message on the issue tracker.
    • If you have a support/usage question or would like to translate xclim to a new language, be sure to check out the existing Static Badge first!

  • If you would like to contribute code or documentation (which is greatly appreciated!), check out the Contributing Guidelines before you begin!

How to cite this library

If you wish to cite xclim in a research publication, we kindly ask that you refer to our article published in The Journal of Open Source Software (JOSS): https://doi.org/10.21105/joss.05415

To cite a specific version of xclim, the bibliographical reference information can be found through Zenodo

License

This is free software: you can redistribute it and/or modify it under the terms of the Apache License 2.0. A copy of this license is provided in the code repository (LICENSE).

Energy and Carbon Usage

The xclim development team is interested in thoroughly testing our software while also reducing the environmental impact of the software we develop. This repository uses the ECO-CI tool to estimate and track the energy use and carbon emissions of our continuous integration workflows.

ECO-CI Energy Use and Carbon Emissions from CI Workflows (since November 2024)

Testing suite

(main branch)

Energy Usage

Energy Consumption (Last run) Energy Consumption (Last 90 days moving average) Energy Consumption (Total)

Carbon Emissions

Carbon Emissions (Last run) Carbon Emissions (Last 90 days moving average) Carbon Emissions (Total)

Credits

xclim development is funded through Ouranos, Environment and Climate Change Canada (ECCC), the Fonds vert and the Fonds d’électrification et de changements climatiques (FECC), the Canadian Foundation for Innovation (CFI), and the Fonds de recherche du Québec (FRQ).

This package was created with Cookiecutter and the audreyfeldroy/cookiecutter-pypackage project template.

Metadata

Release files for xclim 1.0.0

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

Source distribution (sdist)

Source distribution for xclim 1.0.0
File Size Uploaded Provenance Actions
xclim-1.0.0.tar.gz 641.0 kB With provenance Details for xclim-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for xclim 1.0.0
File Interpreter ABI Platform Actions
xclim-1.0.0-py3-none-any.whl Python 3 none any Details for xclim-1.0.0-py3-none-any.whl

Total release size: 1.1 MB

Release files / xclim-1.0.0.tar.gz

Download URL xclim-1.0.0.tar.gz
Size 641.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e06477defa0ce9bb599e426ff129c3f729bceae856c38cccdd1b69aeccf1c3d6
BLAKE2b-256 checksum
How to use checksums
e0aa6cb4aba6455ada42b33cc85f6fa232f43762bba5c39fe885c461bf4982fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Release files / xclim-1.0.0-py3-none-any.whl

Download URL xclim-1.0.0-py3-none-any.whl
Size 411.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
000869ca673cd1a6627ab3986fab306011f02b5c4767f4ae388abb0a9703d197
BLAKE2b-256 checksum
How to use checksums
e1b21eb0d666eb5fe81a7d6f2b6b22453dd4b21888ccbdd84aa71f07e186d0aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Security for xclim 1.0.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for xclim-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

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