|
| 1 | +# 2. Choose STAC library |
| 2 | + |
| 3 | +Date: 2021-03-01 |
| 4 | + |
| 5 | +## Status |
| 6 | + |
| 7 | +Accepted |
| 8 | + |
| 9 | +## Context |
| 10 | + |
| 11 | +We would like to use an existing Python library for working with STAC objects as Python objects. Ideally this library |
| 12 | +will meet the following requirements: |
| 13 | + |
| 14 | +* **Actively maintained** to ensure that it is up-to-date with the latest STAC spec |
| 15 | +* **Well-documented** to reduce the documentation burden for this library |
| 16 | +* **Easily extensible** to allow us to take advantage of existing STAC object functionality |
| 17 | + |
| 18 | +The 2 most obvious choices for Python STAC clients are |
| 19 | +[`PySTAC`](https://github.com/stac-utils/pystac) and [`sat-stac`](https://github.com/sat-utils/sat-stac). |
| 20 | + |
| 21 | +### `PySTAC` |
| 22 | + |
| 23 | +`PySTAC` is an actively maintained STAC client for Python 3. Its last release was less than 2 months ago and its last |
| 24 | +commit was less than 2 weeks ago. It has had 15 contributors within the last year and it supports the latest release |
| 25 | +candidate for the STAC spec (as well as previous releases). `PySTAC` hosts |
| 26 | +[documentation on ReadTheDocs](https://pystac.readthedocs.io/en/latest/) that includes a description of programming |
| 27 | +concepts related to the library, quickstart instructions, tutorials, and an API reference. |
| 28 | + |
| 29 | +`PySTAC` supports both reading and writing of STAC objects. Extending `PySTAC` classes through inheritance is made a |
| 30 | +bit more difficult by the fact that some class methods (like ``from_dict``) have references to specific classes |
| 31 | +(like ``Catalog``) rather than using the ``cls`` argument. This will require us to overwrite some of these methods to |
| 32 | +implement inheritance. It has robust support for traversing catalogs using links. There is no existing support for the |
| 33 | +STAC API spec in `PySTAC` or any related tooling. |
| 34 | + |
| 35 | +### `sat-stac` |
| 36 | + |
| 37 | +`sat-stac` is an actively maintained STAC client for Python 3. Its last release was less than 2 months ago and its |
| 38 | +last commit was at that same time. It has had 2 contributors within the last year and it supports the latest release |
| 39 | +candidate for the STAC spec (as well as previous releases). `sat-stac` has installation documented in the GitHub repo's |
| 40 | +main README and has 2 tutorials in the form of Jupyter Notebooks in that repo. |
| 41 | + |
| 42 | +`sat-stac` supports reading STAC catalogs (support for writing STAC catalogs was removed in v0.4.0). There is also an |
| 43 | +existing library for working with STAC API - Item Search results called |
| 44 | +[sat-search](https://github.com/sat-utils/sat-search) that uses `sat-stac` as its backend. |
| 45 | + |
| 46 | +## Decision |
| 47 | + |
| 48 | +We will use `PySTAC` as our "backend" for working with STAC objects in Python. While both libraries are well-maintained, |
| 49 | +`PySTAC` has more thorough documentation and seems to be more widely supported through community contribution. |
| 50 | + |
| 51 | +## Consequences |
| 52 | + |
| 53 | +We will need to create our own implementation of a STAC API - Item Search client since there is not existing tooling |
| 54 | +based on `PySTAC`. We will be able to point to the hosted documentation for `PySTAC` to guide users through existing |
| 55 | +functionality for navigating STAC Catalogs. Special care should be taken to ensure that we do not break any of |
| 56 | +`PySTAC`'s functionality through inheritance. |
0 commit comments