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
This library is for displaying information (tables, calendars, plots, histograms) about [STAC](https://stacspec.org/) Items in the terminal. It takes as input a STAC ItemCollection (a GeoJSON FeatureCollection of STAC Items), either by specifying a filename or by piping output from another program.
3
+
This library is for displaying information (tables, calendars, plots,
4
+
histograms) about [STAC](https://stacspec.org/) Items in the terminal. It takes
5
+
as input a STAC ItemCollection (a GeoJSON FeatureCollection of STAC Items),
6
+
either by specifying a filename or by piping output from another program.
4
7
5
8
## Installation
6
9
7
10
Install from PyPi:
8
11
9
-
```
10
-
$ pip install stacterm
12
+
```cmdline
13
+
❯ pip install stacterm
11
14
```
12
15
13
-
PySTAC and Pandas are required, along with two dependencies for rendering tables ([termtables](https://pypi.org/project/termtables/)) and plots ([plotext](https://pypi.org/project/plotext/)) in the terminal.
16
+
PySTAC and Pandas are required, along with two dependencies for rendering
17
+
tables ([termtables](https://pypi.org/project/termtables/)) and plots
18
+
([plotext](https://pypi.org/project/plotext/)) in the terminal.
14
19
15
20
## Usage
16
21
17
-
stacterm main usage is as a CLI progam `stacterm`. Use help to see options available:
22
+
stacterm main usage is as a CLI progam `stacterm`. Use help to see options
23
+
available:
18
24
19
-
```
20
-
$ stacterm -h
25
+
```cmdline
26
+
❯ stacterm -h
21
27
usage: stacterm [-h] {table,cal,hist,plot} ...
22
28
23
29
Terminal STAC
@@ -33,7 +39,8 @@ optional arguments:
33
39
-h, --help show this help message and exit
34
40
```
35
41
36
-
All of the sub-commands in `stacterm` can take optional field names. A field name is:
42
+
All of the sub-commands in `stacterm` can take optional field names. A field
43
+
name is:
37
44
38
45
-`id`: The ID of the Item
39
46
-`collection`: The collection of the Item
@@ -43,22 +50,27 @@ All of the sub-commands in `stacterm` can take optional field names. A field nam
43
50
-`year`: The year of the Item's `datetime` field
44
51
- Any property
45
52
46
-
The detailed usage examples below are shown using a saved file, however `stacterm` can also read in stdin allowing other programs to pipe output to it, such as [pystac-client](https://github.com/stac-utils/pystac-client).
53
+
`stacterm` reads from in stdin allowing other programs to pipe output to it,
54
+
such as [pystac-client](https://github.com/stac-utils/pystac-client).
The style of the table can also be changed via the `--style` keyword, although it will no longer be usable in a Markdown renderer. See [termtables styles](https://github.com/nschloe/termtables/blob/master/termtables/styles.py) for list of styles.
106
+
The style of the table can also be changed via the `--style` keyword, although
107
+
it will no longer be usable in a Markdown renderer. See [termtables
A UNIX-like calendar (see [`cal`](https://en.wikipedia.org/wiki/Cal_(Unix))) is available to show dates of individual items. By default `cal` will use the field `datetime` (the collection datetime) and group Items by their Collection. These can be overridden by the `--date_field` and `--label_field` keywords. Note that the specified `--date_field` needs to be a date field, such as `created` or `updated`. `--label_field` will group and label items by the provided field.
130
+
A UNIX-like calendar (see [`cal`](https://en.wikipedia.org/wiki/Cal_(Unix))) is
131
+
available to show dates of individual items. By default `cal` will use the
132
+
field `datetime` (the collection datetime) and group Items by their Collection.
133
+
These can be overridden by the `--date_field` and `--label_field` keywords.
134
+
Note that the specified `--date_field` needs to be a date field, such as
135
+
`created` or `updated`. `--label_field` will group and label items by the
136
+
provided field.
110
137
111
-
```
112
-
$ stacterm cal items.json --date_field created --label_field gsd
138
+
```cmdline
139
+
❯ <input.json stacterm cal --date_field created --label_field gsd
113
140
```
114
141
115
142

116
143
117
144
### Histograms
118
145
119
-
Histograms can be created for any numeric field and `datetime` and `date` (just the date portion of `datetime`). `created` and `updated` may also be specified if available in all Items.
146
+
Histograms can be created for any numeric field and `datetime` and `date` (just
147
+
the date portion of `datetime`). `created` and `updated` may also be specified
148
+
if available in all Items.
120
149
121
-
```
122
-
$ stacterm hist items.json eo:cloud_cover
150
+
```cmdline
151
+
❯ <items.json stacterm hist eo:cloud_cover
123
152
```
124
153
125
154

126
155
127
156
### Plots
128
157
129
-
Plots can be created with a single numeric fields, a date field (`datetime`, `date`, `created`, or `updated`) and a numeric field, or two numeric fields. If a single field it will be plotted against the scene number. The `--sort` keyword can control how to sort the data if plotting a single field.
158
+
Plots can be created with a single numeric fields, a date field (`datetime`,
159
+
`date`, `created`, or `updated`) and a numeric field, or two numeric fields. If
160
+
a single field it will be plotted against the scene number. The `--sort`
161
+
keyword can control how to sort the data if plotting a single field.
For histograms and plots there are options for changing the marker (symbol) and color of the plot, background, and text. These options all come directly from [plotext](https://github.com/piccolomo/plotext).
171
+
For histograms and plots there are options for changing the marker (symbol) and
172
+
color of the plot, background, and text. These options all come directly from
173
+
[plotext](https://github.com/piccolomo/plotext).
141
174
142
-
In addition to a marker being able to be any single character, the following names can also be provided for these symbols:
175
+
In addition to a marker being able to be any single character, the following
Currently any provided field must exist in all STAC Items.
154
187
155
-
156
188
## Development
157
189
158
-
There are a lot more options in the [plotext library](https://github.com/piccolomo/plotext) that could be surfaced here. Additionally, if [support for datetimes](https://github.com/piccolomo/plotext/issues/7) in histograms and plots is added, `stacterm` could create temporal histograms, or plot quantities vs date.
190
+
There are a lot more options in the [plotext
191
+
library](https://github.com/piccolomo/plotext) that could be surfaced here.
192
+
Additionally, if [support for
193
+
datetimes](https://github.com/piccolomo/plotext/issues/7) in histograms and
194
+
plots is added, `stacterm` could create temporal histograms, or plot quantities
0 commit comments