Registry / http-networking / python-cmr

python-cmr

JSON →
library0.13.0pypypi✓ verified 82d ago

Python wrapper to the NASA Common Metadata Repository (CMR) API. Version 0.13.0, supports Python 3.8-3.12. Active development, irregular releases.

pip install python-cmr
INSTALL
IMPORT
SIG · PYTHON-CMR
P
python-cmr
http-networkingpythonv0.13.0
Install
2.3s avg
Import
Disk
20MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.13.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 22.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.3s · import 0.000s · 23MB
20MB installed
● package 20MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CollectionQuery
from cmr import CollectionQuery
from cmr import CMR
GranuleQuery
from cmr import GranuleQuery
Query
from cmr import Query

Basic usage: instantiate CMR client, run collection or granule query, get results.

from cmr import CMR # Initialize CMR client with optional auth cmr = CMR(environment='prod') # Search for collections collections = cmr.collection_query().keyword('temperature').get() print(collections[:2]) # Search for granules granules = cmr.granule_query().short_name('MOD11A1').get() print(granules[:2])
Debug
Known issues
gotchaCalls to `.get()` return raw JSON, not Python objects. Access fields via dictionary keys.
fix
Use `collections[0]['meta']['concept-id']` instead of `collection.concept_id`.
affects: all
breakingCMR API v3 was deprecated in python-cmr 0.10.0; v3 endpoints may be removed in future releases.
fix
Upgrade to latest version; if you rely on v3 specific features, pin to <0.10.0.
affects: >=0.10.0
gotchaEnvironment parameter in CMR() defaults to 'prod'. Use 'uat' for testing. Mixing up environments causes empty results or auth errors.
fix
Explicitly set `CMR(environment='uat')` for test environment.
affects: all
deprecatedThe `CMR().search_collections()` method is deprecated in favor of `CMR().collection_query().get()`.
fix
Replace `cmr.search_collections(...)` with `cmr.collection_query().filter(...).get()`.
affects: >=0.12.0
Upgrade
Version history
0.13.0latest on PyPI · released Sep 13, 2024
Audit
Dependencies
requestsrequiredHTTP client for CMR API calls
python-dateutilrequiredDate parsing for temporal queries
sixoptionalPython 2/3 compatibility
Agent activity
18 hits · last 30 days
node
16
Resources
python-cmr — pip install python-cmr · libregistry