skillfed

python-cmr

Python wrapper to the NASA Common Metadata Repository (CMR) API.

python-cmr v0.13.0 160.1K downloads/30d#10,675 on PyPI29
Permissive license MIT Active released

What it is and what it does

Python CMR is a wrapper library for NASA's EOSDIS Common Metadata Repository API that simplifies querying earth science metadata. It provides query builder classes (CollectionQuery, GranuleQuery, ToolQuery, ServiceQuery, VariableQuery) that let you filter by geographic bounds, temporal ranges, platform, instrument, archive center, and other criteria without manually constructing URLs or handling encoding. The library validates input before sending requests and returns results as JSON-accessible Python dictionaries by default, though it supports multiple output formats including XML, CSV, KML, and others.

The package is designed for researchers and developers who need to discover and access earth observation data from NASA's archive. You chain filter methods together to build queries, then call get() to retrieve results. It handles the details of URL construction and parameter validation, reducing the chance of malformed requests. The library supports both the operational CMR and UAT environments, and can work with authentication tokens for restricted access.

Use it for:

  • Discover satellite imagery collections by archive center and keyword to identify available datasets for your research area
  • Query granules (individual data files) by geographic point or bounding box to find observations covering a specific location
  • Filter granules by temporal range and platform to retrieve data from a specific satellite during a particular time period
  • Retrieve cloud cover and instrument metadata to programmatically select the highest-quality observations for analysis
  • Batch download granule metadata in multiple formats (JSON, XML, CSV, KML) for integration into data processing pipelines
  • Search for tools and services available in the CMR to discover processing capabilities alongside the raw data

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a Python wrapper around NASA's Common Metadata Repository (CMR) API to query earth science collections, granules, services, tools, and variables with input validation and URL encoding.

Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and directly solves the problem of querying NASA's earth science metadata repository. It's well-suited for researchers and developers working with satellite data who want to avoid manual API construction. The permissive MIT license poses no restrictions.

Install

python-cmr on PyPI

pip

pip install python-cmr

uv

uv add python-cmr

poetry

poetry add python-cmr

Installing python-cmr

Before you install

Low friction: pure Python wheel with three common runtime dependencies (python-dateutil, requests, typing-extensions). Actively maintained since its adoption from the original author, with recent commits and no known vulnerabilities.

License in practice

MIT license is permissive; you can use, modify, and distribute this package freely in commercial or private projects with minimal restrictions.

Quickstart

pip install python-cmr

from cmr import CollectionQuery, GranuleQuery

api = CollectionQuery()
collections = api.archive_center("LP DAAC").keyword("AST_L1*").get(5)

api = GranuleQuery()
granules = api.short_name("AST_L1T").point(-112.73, 42.5).get(3)

Verify before relying

  • Whether all CMR API parameters are covered by the current version or if some require direct API calls
  • Performance characteristics when retrieving large result sets (e.g., the 25,000 granule example mentioned)
  • Whether authentication tokens are required for all queries or only certain datasets

Package facts

License MIT (permissive)
Python support supports the current Python release (<4.0.0,>=3.8.1)
Install friction low — pure-Python wheel
Runtime dependencies 3 — python-dateutil, requests, typing-extensions
Maintenance actively maintained — 700 days since the last release
Last repo commit
First released
Downloads 160,058/month — #10,675 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: python_cmr-0.13.0-py3-none-any.whl

Development Status :: 4 - BetaEnvironment :: ConsoleFramework :: IPythonIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Tags

NASA CMR API wrapperearth science metadata querygranule collection searchEOSDIS data discoverygeospatial data catalogsatellite metadata accessearth observation search
nasa-apiearth-sciencegeospatial

More Python Modules packages