You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+58-53Lines changed: 58 additions & 53 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,18 @@
1
+
This repository is a copy of [jddeal/python_cmr](https://github.com/jddeal/python-cmr/tree/ef0f9e7d67ce99d342a568bd6a098c3462df16d2) which is no longer maintained. It has been copied here with the permission of the original author for the purpose of continuing to develop a python library that can be used for CMR access.
Python CMR is an easy to use wrapper to the NASA EOSDIS
8
-
`Common Metadata Repository API <https://cmr.earthdata.nasa.gov/search/>`_. This package aims to make
9
-
querying the API intuitive and less error-prone by providing methods that will preemptively check
10
-
for invalid input and handle the URL encoding the CMR API expects.
10
+
Python CMR is an easy to use wrapper to the NASA EOSDIS [Common Metadata Repository API](https://cmr.earthdata.nasa.gov/search/). This package aims to make querying the API intuitive and less error-prone by providing methods that will preemptively check for invalid input and handle the URL encoding the CMR API expects.
11
11
12
12
Getting access to NASA's earth science metadata is as simple as this:
@@ -33,37 +31,26 @@ Getting access to NASA's earth science metadata is as simple as this:
33
31
SC:AST_L1T.003:2149105820
34
32
SC:AST_L1T.003:2149155037
35
33
36
-
37
34
Installation
38
35
============
39
36
40
37
To install from pypi:
41
38
42
-
::
43
-
44
39
$ pip install python-cmr
45
40
46
-
47
41
To install from github, perhaps to try out the dev branch:
48
42
49
-
::
50
-
51
43
$ git clone https://github.com/jddeal/python-cmr
52
44
$ cd python-cmr
53
45
$ pip install .
54
46
55
-
56
47
Examples
57
48
========
58
49
59
-
This library is broken into two classes, `CollectionQuery` and `GranuleQuery`. Each of these
60
-
classes provide a large set of methods used to build a query for CMR. Not all parameters provided
61
-
by the CMR API are covered by this version of python-cmr.
50
+
This library is broken into two classes, CollectionQuery and GranuleQuery. Each of these classes provide a large set of methods used to build a query for CMR. Not all parameters provided by the CMR API are covered by this version of python-cmr.
62
51
63
52
The following methods are available to both collecton and granule queries:
64
53
65
-
::
66
-
67
54
# search for granules matching a specific product/short_name
68
55
>>> api.short_name("AST_L1T")
69
56
@@ -102,11 +89,11 @@ The following methods are available to both collecton and granule queries:
As an alternative to chaining methods together to set the parameters of your query, a method exists to allow you to pass your parameters as keyword arguments:
141
154
142
155
# search for AST_L1T version 003 granules at latitude 42, longitude -100
143
156
>>> api.parameters(
@@ -146,14 +159,10 @@ method exists to allow you to pass your parameters as keyword arguments:
146
159
point=(-100, 42)
147
160
)
148
161
149
-
Note: the kwarg key should match the name of a method from the above examples, and the value
150
-
should be a tuple if it's a parameter that requires multiple values.
151
-
162
+
Note: the kwarg key should match the name of a method from the above examples, and the value should be a tuple if it's a parameter that requires multiple values.
152
163
153
164
To inspect and retreive results from the API, the following methods are available:
154
165
155
-
::
156
-
157
166
# inspect the number of results the query will return without downloading the results
158
167
>>> print(api.hits())
159
168
@@ -166,30 +175,26 @@ To inspect and retreive results from the API, the following methods are availabl
166
175
# retrieve all the granules possible for the query
167
176
>>> granules = api.get_all() # this is a shortcut for api.get(api.hits())
168
177
169
-
170
-
By default the responses will return as json and be accessible as a list of python dictionaries.
171
-
Other formats can be specified before making the request:
172
-
173
-
::
178
+
By default the responses will return as json and be accessible as a list of python dictionaries. Other formats can be specified before making the request:
174
179
175
180
>>> granules = api.format("echo10").get(100)
176
181
177
182
The following formats are supported for both granule and collection queries:
178
183
179
-
* json (default)
180
-
* xml
181
-
* echo10
182
-
* iso
183
-
* iso19115
184
-
* csv
185
-
* atom
186
-
* kml
187
-
* native
184
+
- json (default)
185
+
- xml
186
+
- echo10
187
+
- iso
188
+
- iso19115
189
+
- csv
190
+
- atom
191
+
- kml
192
+
- native
188
193
189
194
Collection queries also support the following formats:
0 commit comments