Skip to content

Commit c4464f9

Browse files
Merge branch 'main' into carl/oauth-via-plauth-lib
2 parents f9ac787 + e2234fd commit c4464f9

26 files changed

+2850
-110
lines changed

CHANGES.txt

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
2.13.0 (2024-12-18)
2+
- Add Planet class (`from planet import Planet`)
3+
- Planet is a client that uses sync methods. Users do not have
4+
to interact with asyncio to use the sync client.
5+
- the Planet class is implemented by calling out to the async methods.
6+
This should be transparent to users. Depending on uptake and feedback,
7+
the underlying implementation may change in the future (but we will commit
8+
to semantic versioning when it comes to breaking changes in the API).
9+
10+
2.12.0 (2024-12-09)
11+
- Add parameters to the subscriptions list command: --source-type, --created, --start-time,
12+
--end-time, --updated, --hosting, --name, --name-contains, and --sort-by.
13+
- Add parameters to the orders list command: --source-type, --name,
14+
--name-contains, --created-on, --last-modified, --hosting, and --sort-by.
15+
- Remove the unused limit parameter of SubscriptionsClient.get_results_csv
16+
117
2.11.0 (2024-10-21)
218

319
Added:
@@ -448,4 +464,4 @@ package is coming soon. The highlights are
448464

449465
0.0.1 (2015-07-17)
450466
------------------
451-
- Initial release
467+
- Initial release

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,15 @@ These commands can be performed on the entire repository, when run from the repo
141141
and
142142

143143
```console
144-
$ yapf --diff -r .
144+
$ yapf --in-place -r .
145145
```
146146
The configuration for YAPF is given in `setup.cfg` and `.yapfignore`.
147147
See the YAPF link above for advanced usage.
148148

149149
##### Alternative to YAPF
150150

151151
YAPF is not required to follow the style and formatting guidelines. You can
152-
perform all formatting on your own using the linting output as a guild. Painful,
152+
perform all formatting on your own using the linting output as a guide. Painful,
153153
maybe, but possible!
154154

155155
## Testing

docs/cli/cli-orders.md

Lines changed: 71 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ then check out our [CLI Concepts](cli-intro.md) guide.
1515

1616
## Core Workflows
1717

18-
### See Recent Orders
18+
### List Orders
1919

20-
You can use the `list` command to show your recent orders:
20+
You can use the `list` command to see details of existing orders. By default they will be sorted
21+
by most recently created.
2122

2223
```sh
2324
planet orders list
@@ -26,24 +27,10 @@ planet orders list
2627
If you’ve not placed any orders with Explorer, the CLI or the API directly, then the results
2728
of this call will be blank, so you may want to try out some of the create order commands below.
2829

29-
Sometimes that list gets too long, so you can put a limit on how many are returned:
30+
Sometimes that list gets too long, so you can put a limit on how many are returned using the
31+
`--limit` parameter.
3032

31-
```sh
32-
planet orders list --limit 5
33-
```
34-
35-
You can also filter orders by their `state`, which can be useful to just see orders in
36-
progress:
37-
38-
```sh
39-
planet orders list --state running
40-
```
41-
42-
The other options are queued, failed, success, partial and cancelled.
43-
44-
Note you can also get a nice list online as well, at https://www.planet.com/account/#/orders
45-
46-
### Recent Orders with Formatting
33+
#### Formatting
4734

4835
You can also print the list of orders more nicely:
4936

@@ -71,10 +58,13 @@ planet orders list | jq -rs '.[] | "\(.id) \(.created_on) \(.state) \(.name)"'
7158

7259
You can customize which fields you want to show by changing the values.
7360

74-
### Number of recent orders
61+
A list of your orders can also be viewed in a UI at https://www.planet.com/account/#/orders
7562

76-
You can use jq to process the output for more insight, like
77-
get a count of how many recent orders you’ve done.
63+
#### Number of existing orders
64+
65+
You can use `jq` to process the output for more insight, like get a count of how many existing
66+
orders you have. Orders are automatically deleted 90 days after completion, so this number
67+
roughly is equivalent to the number of orders created in the last 90 days.
7868

7969
```sh
8070
planet orders list | jq -s length
@@ -83,6 +73,65 @@ planet orders list | jq -s length
8373
This uses `-s` to collect the output into a single array, and `length` then tells the
8474
length of the array.
8575

76+
#### Filtering
77+
78+
The `list` command supports filtering on a variety of fields:
79+
* `--state`: Filter by order state. Options include `queued`, `failed`, `success`, `partial` and `cancelled`.
80+
* `--source-type`: Filter by source type. Options include `scenes`, `basemaps`, or `all`. The default is `all`.
81+
* `--name`: Filter by name.
82+
* `--name-contains`: Only return orders with a name that contains the provided string.
83+
* `--created-on`: Filter on the order creation time or an interval of creation times.
84+
* `--last-modified`: Filter on the order's last modified time or an interval of last modified times.
85+
* `--hosting`: Filter on orders containing a hosting location (e.g. SentinelHub). Accepted values are `true` or `false`.
86+
87+
Datetime args (`--created-on` and `--last-modified`) can either be a date-time or an interval, open or closed. Date and time expressions adhere to RFC 3339. Open intervals are expressed using double-dots.
88+
* A date-time: `2018-02-12T23:20:50Z`
89+
* A closed interval: `2018-02-12T00:00:00Z/2018-03-18T12:31:12Z`
90+
* Open intervals: `2018-02-12T00:00:00Z/..` or `../2018-03-18T12:31:12Z`
91+
92+
To list orders in progress:
93+
```sh
94+
planet orders list --state running
95+
```
96+
97+
To list orders with the `scenes` source type:
98+
```sh
99+
planet orders list --source-type scenes
100+
```
101+
102+
To list orders that were created in 2024:
103+
```sh
104+
planet orders list --created-on 2024-01-01T00:00:00Z/2025-01-01T00:00:00Z
105+
```
106+
107+
To list orders with a hosting location:
108+
```sh
109+
planet orders list --hosting true
110+
```
111+
112+
To list orders with the name `my location xyz`:
113+
```sh
114+
planet orders list --name "my location xyz"
115+
```
116+
117+
To list orders with a name containing `xyz`:
118+
```sh
119+
planet orders list --name-contains xyz
120+
```
121+
122+
#### Sorting
123+
124+
The `list` command also supports sorting the orders on one or more fields: `name`, `created_on`, `state`, and `last_modified`. The sort direction can be specified by appending ` ASC` or ` DESC` to the field name (default is ascending).
125+
126+
When multiple fields are specified, the sort order is applied in the order the fields are listed.
127+
128+
Sorting examples:
129+
* `--sort-by name`: sorts orders by name alphabetically.
130+
* `--sort-by "created_on DESC"`: sorts orders by most recently created.
131+
* `--sort-by "last_modified DESC"`: sorts subscriptions by most recently modified.
132+
* `--sort-by "state ASC"`: sorts orders by state alphabetically.
133+
* `--sort-by "name,last_modified DESC"`: sorts subscriptions by name first, and most recently modified second.
134+
86135
### Info on an Order
87136

88137
For a bit more information about an order, including the location of any downloads, use

docs/cli/cli-subscriptions.md

Lines changed: 48 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ To create a new subscription with the CLI, use the `create` command and the json
117117
planet subscriptions create my-subscription.json
118118
```
119119

120-
!!!note "Note"
121-
The above command assumes that you’ve saved the subscriptions JSON as `my-subscription.json` and that you’ve replaced the delivery information with your own bucket and credentials.
120+
**Note:** The above command assumes that you’ve saved the subscriptions JSON as `my-subscription.json` and that you’ve replaced the delivery information with your own bucket and credentials.
122121

123122
### List Subscriptions
124123

@@ -134,23 +133,62 @@ parameter higher, or you can set it to 0 and there will be no limit.
134133
You can get nicer formatting with `--pretty` or pipe it into `jq`, just like the other Planet
135134
CLI’s.
136135

137-
The `list` command supports filtering by the status of the subscription:
138-
136+
#### Filtering
137+
138+
The `list` command supports filtering on a variety of fields:
139+
* `--created`: Filter on the subscription creation time or an interval of creation times.
140+
* `--end-time`: Filter on the subscription end time or an interval of end times.
141+
* `--hosting`: Filter on subscriptions containing a hosting location (e.g. SentinelHub). Accepted values are `true` or `false`.
142+
* `--name-contains`: Filter on subscriptions with a name that contains the provided string.
143+
* `--name`: Filter on subscriptions with a specific name
144+
* `--source-type`: Filter by the source type of the subscription. For the full list of available source types, see [Subscription Source Types](https://developers.planet.com/docs/subscriptions/source/#subscription-source-types). Multiple source type args are allowed.
145+
* `--start-time`: Filter on the subscription start time or an interval of start times.
146+
* `--status`: Filter on the status of the subscription. Status options include `running`, `cancelled`, `preparing`, `pending`, `completed`, `suspended`, and `failed`. Multiple status args are allowed.
147+
* `--updated`: Filter on the subscription update time or an interval of updated times.
148+
149+
Datetime args (`--created`, `end-time`, `--start-time`, and `--updated`) can either be a date-time or an interval, open or closed. Date and time expressions adhere to RFC 3339. Open intervals are expressed using double-dots.
150+
* A date-time: `2018-02-12T23:20:50Z`
151+
* A closed interval: `2018-02-12T00:00:00Z/2018-03-18T12:31:12Z`
152+
* Open intervals: `2018-02-12T00:00:00Z/..` or `../2018-03-18T12:31:12Z`
153+
154+
To list currently active subscriptions:
139155
```sh
140156
planet subscriptions list --status running
141157
```
142158

143-
gives you just the currently active subscriptions. The other available statuses are:
144-
`cancelled`, `preparing`, `pending`, `completed`, `suspended`, and `failed`.
159+
To list subscriptions with the `catalog` source type:
160+
```sh
161+
planet subscriptions list --source-type catalog
162+
```
145163

146-
The `list` command also supports filtering by the source type of the subscription:
164+
To list subscriptions that were created in 2024:
165+
```sh
166+
planet subscriptions list --created 2024-01-01T00:00:00Z/2025-01-01T00:00:00Z
167+
```
147168

169+
To list subscriptions with an end time after Jan 1, 2025:
148170
```sh
149-
planet subscriptions list --source-type catalog
171+
planet subscriptions list --end-time 2025-01-01T00:00:00Z/..
150172
```
151173

152-
only gives you subscriptions with the `catalog` source type. For the full list of available source types,
153-
see [Subscription Source Types](https://developers.planet.com/docs/subscriptions/source/#subscription-source-types).
174+
To list subscriptions with a hosting location:
175+
```sh
176+
planet subscriptions list --hosting true
177+
```
178+
179+
#### Sorting
180+
181+
The `list` command also supports sorting the subscriptions on one or more fields: `name`, `created`, `updated`, `start_time`, and `end_time`. The sort direction can be specified by appending ` ASC` or ` DESC` to the field name (default is ascending).
182+
183+
When multiple fields are specified, the sort order is applied in the order the fields are listed.
184+
185+
Sorting examples:
186+
* `--sort-by name`: sorts subscriptions by name alphabetically.
187+
* `--sort-by "created DESC"`: sorts subscriptions by most recently created.
188+
* `--sort-by "updated DESC"`: sorts subscriptions by most recently updated.
189+
* `--sort-by "start_time ASC"`: sorts subscriptions by start time (earliest to latest)
190+
* `--sort-by "end_time DESC"`: sorts subscriptions by end time (latest to earliest)
191+
* `--sort-by "name,start_time DESC"`: sorts subscriptions by name ascending first, and start time descending second.
154192

155193
### Get Subscription
156194

0 commit comments

Comments
 (0)