{"id":34024520,"url":"https://github.com/prajeeshag/xcdo","last_synced_at":"2026-01-23T09:31:47.110Z","repository":{"id":264822582,"uuid":"894049377","full_name":"prajeeshag/xcdo","owner":"prajeeshag","description":"Command-line tool for climate data processing: Xarray with CDO like interface.","archived":false,"fork":false,"pushed_at":"2025-12-09T05:34:23.000Z","size":1022,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-15T06:22:05.695Z","etag":null,"topics":["cdo","chainable-cli-operators","cli","climate-data-analysis","climate-data-visualization","operator","xarray","xarray-cli"],"latest_commit_sha":null,"homepage":"http://prajeesh-ag.com/xcdo/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prajeeshag.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-25T16:57:06.000Z","updated_at":"2025-12-09T05:34:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"ea1216b9-3aa0-4a2e-8e0f-ebcf4cf3c608","html_url":"https://github.com/prajeeshag/xcdo","commit_stats":null,"previous_names":["prajeeshag/xcdo"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/prajeeshag/xcdo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prajeeshag%2Fxcdo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prajeeshag%2Fxcdo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prajeeshag%2Fxcdo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prajeeshag%2Fxcdo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prajeeshag","download_url":"https://codeload.github.com/prajeeshag/xcdo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prajeeshag%2Fxcdo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28686415,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T05:48:07.525Z","status":"ssl_error","status_checked_at":"2026-01-23T05:48:07.129Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cdo","chainable-cli-operators","cli","climate-data-analysis","climate-data-visualization","operator","xarray","xarray-cli"],"created_at":"2025-12-13T16:23:25.894Z","updated_at":"2026-01-23T09:31:47.102Z","avatar_url":"https://github.com/prajeeshag.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# XCDO\n\n![Test](https://github.com/prajeeshag/xcdo/actions/workflows/test.yml/badge.svg)\n[![codecov](https://codecov.io/gh/prajeeshag/xcdo/graph/badge.svg?token=UNNUW30IQL)](https://codecov.io/gh/prajeeshag/xcdo)\n![PyPI - Version](https://img.shields.io/pypi/v/xcdo)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/clios)\n![Doc](https://github.com/prajeeshag/xcdo/actions/workflows/build-docs.yml/badge.svg)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)\n\n\n**XCDO** is a Python-based command-line tool built around [Xarray](https://docs.xarray.dev/en/stable/). It provides a collection of operators for working with datasets such as NetCDF, GRIB, and Zarr, using a familiar [CDO](https://code.mpimet.mpg.de/projects/cdo/) like interface. With the help of Python’s type annotations, creating new operators becomes effortless, making it easy to extend the tool with simple functions and build reusable, organised analysis workflows.\n\n## Installation\n```bash\n$ pip install xcdo\n```\n\n!!! warning \"Windows support!\"\n    - Not well tested on Windows. But it should work! :wink:\n\n\u003cbr\u003e\n### Installing in a virtual environment\nYou may want to install `xcdo` to an isolated virtual environment to avoid conflicts with other packages.\n\n### [micromamba](https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html)/[mamba](https://mamba.readthedocs.io/en/latest/)/[conda](https://docs.conda.io/en/latest/)\n\n```bash\n# Choose any of: micromamba, mamba, or conda\n$ micromamba create -n xcdo python=3.13\n$ micromamba activate xcdo\n(xcdo)$ pip install xcdo\n```\n\n### [uv](https://docs.astral.sh/uv/)\n\n```bash\n$ uv venv --python 3.13 .venv\n$ source .venv/bin/activate\n(.venv)$ pip install xcdo\n```\n\n## Usage\n\nGenerally, XCDO works much like [CDO](https://code.mpimet.mpg.de/projects/cdo/wiki). For example:\n```bash\n$ xcdo -selvar,var1 indata.nc outdata.nc\n$ xcdo -timemean -zonmean in.nc out.nc\n```\n\u003cbr\u003e\n\nYou can find a list of all available operators [here](operators/index.md).\nor run `xcdo --list` on the command line.\n```bash\n$ xcdo --list\n\n                            Available Operators\n┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n┃ Operator      ┃ Description                                   ┃\n┡━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n│ cdo           │ Operator to run CDO commands                  │\n│ showtimestamp │ Show time stamp                               │\n│ mermean       │ Meridional mean                               │\n│ mermin        │ Meridional minimum                            │\n│ mermax        │ Meridional maximum                            │\n│ merstd        │ Meridional standard deviation                 │\n│ mersum        │ Meridional sum                                │\n```\n\u003cbr\u003e\n\nTo get detailed information and the synopsis (or signature) about a specific operator, use:\n```bash\n$ xcdo --show \u003coperator\u003e\n```\n```bash\n$ xcdo --show selvar\n╭─ Synopsis ──────────────────────────────────────────────────╮\n│                                                             │\n│  xcdo -selvar,name input output                             │\n│                                                             │\n╰─────────────────────────────────────────────────────────────╯\n╭─ Description ───────────────────────────────────────────────╮\n│                                                             │\n│  Select a data variable by name.                            │\n│                                                             │\n╰─────────────────────────────────────────────────────────────╯\n                 Positional Arguments\n┏━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┓\n┃ Parameter ┃ Type ┃ Required ┃ Description          ┃\n┡━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━┩\n│ name      │ TEXT │ Required │ Name of the variable │\n└───────────┴──────┴──────────┴──────────────────────┘\n╭─ Examples ──────────────────────────────────────────────────╮\n│                                                             │\n│  xcdo -selvar,tas infile.nc outfile.nc                      │\n│  xcdo -selname,tas infile.nc outfile.nc                     │\n│                                                             │\n╰─────────────────────────────────────────────────────────────╯\n```\n\u003cbr\u003e\n\n## User-defined operators\nYou can easily turn a regular Python function into your own XCDO operator. For example, here’s a small operator in a file named dump.py that simply prints a dataset to the terminal:\n\n```py title=\"dump.py\"\n# dump.py\nfrom xcdo import operator, DatasetIn\n\n@operator()\ndef main(input: DatasetIn):\n    print(input)\n```\n\nAnd this can be used as follows in `xcdo`:\n\n```bash\n$ xcdo -dump.py in.nc\n```\nYou can see the signature and documentation of the custom operator by running:\n\n```bash\n$ xcdo --show dump.py\n\n╭─ Synopsis ──────────────────────────────────────────────────╮\n│                                                             │\n│  xcdo -dump.py input                                        │\n│                                                             │\n╰─────────────────────────────────────────────────────────────╯\n\n```\n!!! Note\n    Notice the `.py` extension on the custom operator? That’s because the operator name simply comes from the Python file’s name.\n\nSee [Writing your own operators](user_defined_operators.md) for more details.\n\n## Why XCDO?\n- **Simple Python functions**. If you know Python, you can create new operators instantly. This opens the door for real community-driven development.\n- **Automatic help and documentation**. XCDO automatically generates help and documentation for your operators, making it easy to share and reuse them.\n- **CLI and Library**. As these operators are Python functions, it can be called from Python scripts as well.\n- **Custom operators**. Drop a Python function into a file and call it like any other XCDO operator. This keeps your analysis workflows clean, modular, and easy to reuse.\n- **Zarr support**. Since XCDO builds on Xarray, it naturally supports modern formats like Zarr, which CDO doesn’t handle yet.\n- **CDO integration**. When you need the performance of CDO, you can call it directly with the “-cdo” operator and combine it with XCDO or custom operators in one chain.\n\n\nWith community support, XCDO can grow into a unified library of reusable and well-structured tools for climate and weather analysis.\n\n\n## Issues\nPlease report any issues [here](https://github.com/prajeeshag/xcdo/issues).\n\n## Contributing\nFork the [repository](https://github.com/prajeeshag/xcdo) and make your changes and submit a pull request.\n\nPlease contact me at [prajeeshag@gmail.com](mailto:prajeeshag@gmail.com) for any questions or start a discussion on [GitHub Discussions](https://github.com/prajeeshag/xcdo/discussions).\n\n!!! warning \"Under active development\"\n    XCDO is under active development. Although everything will work as expected, many features are not documented well yet.\n\n\u003c!--For a more complete example including more features, see the Tutorial - User Guide.--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprajeeshag%2Fxcdo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprajeeshag%2Fxcdo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprajeeshag%2Fxcdo/lists"}