|
1 | | -# SuperSTAC |
| 1 | +# SuperSTAC |
2 | 2 |
|
3 | | -a Python library designed for high-availability satellite imagery retrieval. If one data source lacks the requested imagery, DeepEO seamlessly queries alternative sources until it finds a valid result. |
| 3 | +[](https://pypi.org/project/superstac/) |
| 4 | +[](./LICENSE) |
4 | 5 |
|
| 6 | +**SuperSTAC** is a Python library (with planned Rust backend) for **high-availability satellite imagery retrieval**. |
| 7 | +Instead of relying on a single STAC endpoint (e.g., Sentinel from Element84), SuperSTAC can query **multiple catalogs** and automatically fall back to alternatives when a source is missing data or unavailable. |
5 | 8 |
|
6 | | -# Dependencies |
| 9 | +⚠️ **Note:** This is an **early work-in-progress**. The initial release is to start iterating in public. Expect breaking changes. |
7 | 10 |
|
8 | | -- pystac-client. |
| 11 | +--- |
9 | 12 |
|
| 13 | +## Features (planned) |
10 | 14 |
|
11 | | -### Configuration YML |
| 15 | +- Query multiple STAC catalogs through a single unified API. |
| 16 | +- Automatic fallback when a catalog has no data or is down. |
| 17 | +- Configurable authentication for protected catalogs. |
| 18 | +- Resolution & band matching across heterogeneous catalogs. |
| 19 | +- CLI and Python API for flexible workflows. |
| 20 | +- Optional LLM-assisted natural language queries. |
| 21 | +- Rust backend (planned) |
12 | 22 |
|
13 | | -Template: |
| 23 | +--- |
14 | 24 |
|
| 25 | +## Installation |
| 26 | + |
| 27 | +```bash |
| 28 | +pip install superstac |
15 | 29 | ``` |
| 30 | + |
| 31 | +## Configuration |
| 32 | + |
| 33 | +SuperSTAC loads its catalog configuration from a YAML file, typically referenced via the environment variable `SUPERSTAC_CATALOG_CONFIG`. |
| 34 | + |
| 35 | +Example `.superstac.yml`: |
| 36 | + |
| 37 | +```bash |
16 | 38 | catalogs: |
17 | | - Catalog Name: |
18 | | - url: Catalog URL |
| 39 | + Element84 Sentinel: |
| 40 | + url: https://earth-search.aws.element84.com/v0 |
| 41 | + Planet: |
| 42 | + url: https://api.planet.com/stac/v1 |
19 | 43 | auth: |
20 | | - type: bearer |
21 | | - token: "YOUR_MICROSOFT_PC_TOKEN" |
22 | | - Catalog Name: |
23 | | - url: Catalog URL |
24 | | - type: basic |
| 44 | + type: basic |
25 | 45 | username: youruser |
26 | 46 | password: yourpass |
| 47 | + Microsoft PC: |
| 48 | + url: https://planetarycomputer.microsoft.com/api/stac/v1 |
| 49 | + auth: |
| 50 | + type: bearer |
| 51 | + token: "YOUR_MICROSOFT_PC_TOKEN" |
27 | 52 | ``` |
28 | | -# load from the environment variable - SUPERSTAC_CATALOG_CONFIG |
| 53 | +See [superstac/.superstac.yml](superstac/.superstac.yml) for an example config file. |
| 54 | + |
| 55 | + |
| 56 | +## Usage (very early draft) |
| 57 | + |
| 58 | +```python |
| 59 | + from superstac import get_catalog_registry, federated_search_async |
| 60 | + |
| 61 | + cr = get_catalog_registry() |
| 62 | + cr.load_catalogs_from_config() |
| 63 | + |
| 64 | + print("\nRunning asynchronous federated_search_async...") |
| 65 | + start_async = time.perf_counter() |
| 66 | + results_async = asyncio.run( |
| 67 | + federated_search_async( |
| 68 | + registry=cr, |
| 69 | + collections=["sentinel-2-l2a"], |
| 70 | + bbox=[6.0, 49.0, 7.0, 50.0], |
| 71 | + datetime="2024-01-01/2024-01-31", |
| 72 | + query={"eo:cloud_cover": {"lt": 20}}, |
| 73 | + sortby=[{"field": "properties.datetime", "direction": "desc"}], |
| 74 | + ) |
| 75 | + ) |
| 76 | + end_async = time.perf_counter() |
| 77 | + print( |
| 78 | + f"Asynchronous search found {len(results_async)} items in {end_async - start_async:.2f} seconds." |
| 79 | + ) |
| 80 | + |
| 81 | + for x in results_async: |
| 82 | + print(x.self_href) |
| 83 | +``` |
| 84 | + |
| 85 | +Also see [main.py](./main.py). |
| 86 | + |
| 87 | +## Development Status / Roadmap |
29 | 88 |
|
30 | | -# Todo - auth configuration documentation. |
| 89 | +Planned enhancements: |
| 90 | + - Authentication configuration & documentation |
| 91 | + - Retry logic |
| 92 | + - Result modifiers |
| 93 | + - Catalog refresh & health checks |
| 94 | + - Latency tracking and fallback ranking |
| 95 | + - Band matching across heterogeneous catalogs |
| 96 | + - CLI tool |
| 97 | + - Example notebooks (illegal mining detection, disaster response, LLM-assisted search) |
31 | 98 |
|
32 | | -See [.superstac.yml](./superstac/.superstac.yml) for an example configuration file. |
33 | 99 |
|
| 100 | +## License |
34 | 101 |
|
35 | | -# todo |
| 102 | +MIT License. See [LICENSE](LICENSE). |
36 | 103 |
|
37 | | -- retries - https://pystac-client.readthedocs.io/en/stable/usage.html#configuring-retry-behavior |
38 | | -- modifier - https://pystac-client.readthedocs.io/en/stable/usage.html#automatically-modifying-results |
39 | | -- refresh |
40 | | -- auth |
41 | | -- ues cases e.g when a catalog is offline - store latency ? |
42 | | -- when a catalog is specified and changed it still works - band matching |
| 104 | +Feedback, issues, and contributions are welcome! This package is at a very early stage, so opening issues for missing features or edge cases will directly shape the roadmap. |
0 commit comments