@@ -87,32 +87,32 @@ def series():
87
87
88
88
89
89
@command (mosaics , name = "contributions" )
90
- @click .argument ("name " )
90
+ @click .argument ("name_or_id " )
91
91
@click .argument ("quad" )
92
- async def quad_contributions (ctx , name , quad , pretty ):
93
- '''Get contributing scenes for a mosaic quad
92
+ async def quad_contributions (ctx , name_or_id , quad , pretty ):
93
+ '''Get contributing scenes for a quad in a mosaic specified by name or ID
94
94
95
95
Example:
96
96
97
97
planet mosaics contribution global_monthly_2025_04_mosaic 575-1300
98
98
'''
99
99
async with client (ctx ) as cl :
100
- item = await cl .get_quad (name , quad )
100
+ item = await cl .get_quad (name_or_id , quad )
101
101
await _output (cl .get_quad_contributions (item ), pretty )
102
102
103
103
104
104
@command (mosaics , name = "info" )
105
- @click .argument ("name " , required = True )
105
+ @click .argument ("name_or_id " , required = True )
106
106
@include_links
107
- async def mosaic_info (ctx , name , pretty , links ):
108
- """Get information for a specific mosaic
107
+ async def mosaic_info (ctx , name_or_id , pretty , links ):
108
+ """Get information for a mosaic specified by name or ID
109
109
110
110
Example:
111
111
112
112
planet mosaics info global_monthly_2025_04_mosaic
113
113
"""
114
114
async with client (ctx ) as cl :
115
- await _output (cl .get_mosaic (name ), pretty , links )
115
+ await _output (cl .get_mosaic (name_or_id ), pretty , links )
116
116
117
117
118
118
@command (mosaics , name = "list" )
@@ -128,11 +128,11 @@ async def mosaics_list(ctx,
128
128
acquired_lt ,
129
129
pretty ,
130
130
links ):
131
- """List all mosaics
131
+ """List information for all available mosaics
132
132
133
133
Example:
134
134
135
- planet mosaics info global_monthly_2025_04_mosaic
135
+ planet mosaics list --name-contains global_monthly
136
136
"""
137
137
async with client (ctx ) as cl :
138
138
await _output (
@@ -145,17 +145,17 @@ async def mosaics_list(ctx,
145
145
146
146
147
147
@command (series , name = "info" )
148
- @click .argument ("name " , required = True )
148
+ @click .argument ("name_or_id " , required = True )
149
149
@include_links
150
- async def series_info (ctx , name , pretty , links ):
151
- """Get information for a specific series
150
+ async def series_info (ctx , name_or_id , pretty , links ):
151
+ """Get information for a series specified by name or ID
152
152
153
153
Example:
154
154
155
155
planet series info "Global Quarterly"
156
156
"""
157
157
async with client (ctx ) as cl :
158
- await _output (cl .get_series (name ), pretty , links )
158
+ await _output (cl .get_series (name_or_id ), pretty , links )
159
159
160
160
161
161
@command (series , name = "list" )
@@ -171,7 +171,7 @@ async def series_list(ctx,
171
171
acquired_lt ,
172
172
pretty ,
173
173
links ):
174
- """List series
174
+ """List information for available series
175
175
176
176
Example:
177
177
@@ -180,39 +180,39 @@ async def series_list(ctx,
180
180
async with client (ctx ) as cl :
181
181
await _output (
182
182
cl .list_series (
183
- name_contains ,
184
- interval ,
185
- acquired_gt ,
186
- acquired_lt ,
183
+ name_contains = name_contains ,
184
+ interval = interval ,
185
+ acquired_gt = acquired_gt ,
186
+ acquired_lt = acquired_lt ,
187
187
),
188
188
pretty ,
189
189
links )
190
190
191
191
192
192
@command (series , name = "list-mosaics" )
193
- @click .argument ("name " , required = True )
193
+ @click .argument ("name_or_id " , required = True )
194
194
@click .option ("--latest" ,
195
195
is_flag = True ,
196
196
help = ("Get the latest mosaic in the series" ))
197
197
@acquired_gt
198
198
@acquired_lt
199
199
@include_links
200
200
async def list_series_mosaics (ctx ,
201
- name ,
201
+ name_or_id ,
202
202
acquired_gt ,
203
203
acquired_lt ,
204
204
latest ,
205
- links ,
206
- pretty ):
207
- """List mosaics in a series
205
+ pretty ,
206
+ links ):
207
+ """List mosaics in a series specified by name or ID
208
208
209
209
Example:
210
210
211
211
planet mosaics series list-mosaics global_monthly_2025_04_mosaic
212
212
"""
213
213
async with client (ctx ) as cl :
214
214
await _output (
215
- cl .list_series_mosaics (name ,
215
+ cl .list_series_mosaics (name_or_id ,
216
216
acquired_gt = acquired_gt ,
217
217
acquired_lt = acquired_lt ,
218
218
latest = latest ),
@@ -221,24 +221,24 @@ async def list_series_mosaics(ctx,
221
221
222
222
223
223
@command (mosaics , name = "search" )
224
- @click .argument ("name " , required = True )
224
+ @click .argument ("name_or_id " , required = True )
225
225
@bbox
226
226
@geometry
227
227
@click .option ("--summary" ,
228
228
is_flag = True ,
229
229
help = ("Get a count of how many quads would be returned" ))
230
230
@include_links
231
- async def list_quads (ctx , name , bbox , geometry , summary , links , pretty ):
232
- """Search quads
231
+ async def list_quads (ctx , name_or_id , bbox , geometry , summary , pretty , links ):
232
+ """Search quads in a mosaic specified by name or ID
233
233
234
234
Example:
235
235
236
236
planet mosaics search global_monthly_2025_04_mosaic --bbox -100,40,-100,41
237
237
"""
238
238
async with client (ctx ) as cl :
239
- mosaic = await cl .get_mosaic (name )
239
+ mosaic = await cl .get_mosaic (name_or_id )
240
240
if mosaic is None :
241
- raise click .ClickException ("No mosaic named " + name )
241
+ raise click .ClickException ("No mosaic named " + name_or_id )
242
242
await _output (
243
243
cl .list_quads (mosaic ,
244
244
minimal = False ,
@@ -250,28 +250,27 @@ async def list_quads(ctx, name, bbox, geometry, summary, links, pretty):
250
250
251
251
252
252
@command (mosaics , name = "download" )
253
- @click .argument ("name " , required = True )
253
+ @click .argument ("name_or_id " , required = True )
254
254
@click .option ('--output-dir' ,
255
- default = '.' ,
256
- help = ('Directory for file download.' ),
255
+ help = ('Directory for file download. Defaults to mosaic name' ),
257
256
type = click .Path (exists = True ,
258
257
resolve_path = True ,
259
258
writable = True ,
260
259
file_okay = False ))
261
260
@bbox
262
261
@geometry
263
- async def download (ctx , name , output_dir , bbox , geometry , ** kwargs ):
264
- """Download quads from a mosaic
262
+ async def download (ctx , name_or_id , output_dir , bbox , geometry , ** kwargs ):
263
+ """Download quads from a mosaic by name or ID
265
264
266
265
Example:
267
266
268
267
planet mosaics search global_monthly_2025_04_mosaic --bbox -100,40,-100,41
269
268
"""
270
269
quiet = ctx .obj ['QUIET' ]
271
270
async with client (ctx ) as cl :
272
- mosaic = await cl .get_mosaic (name )
271
+ mosaic = await cl .get_mosaic (name_or_id )
273
272
if mosaic is None :
274
- raise click .ClickException ("No mosaic named " + name )
273
+ raise click .ClickException ("No mosaic named " + name_or_id )
275
274
await cl .download_quads (mosaic ,
276
275
bbox = bbox ,
277
276
geometry = geometry ,
0 commit comments