Skip to content

Commit 3772711

Browse files
committed
chore: wip
1 parent 83a447c commit 3772711

File tree

10 files changed

+131
-0
lines changed

10 files changed

+131
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,31 @@
11
# SuperSTAC
2+
23
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.
4+
5+
6+
# Dependencies
7+
8+
- pystac-client.
9+
10+
11+
### Configuration YML
12+
13+
Template:
14+
15+
```
16+
catalogs:
17+
Catalog Name:
18+
url: Catalog URL
19+
auth:
20+
type: bearer
21+
token: "YOUR_MICROSOFT_PC_TOKEN"
22+
Catalog Name:
23+
url: Catalog URL
24+
type: basic
25+
username: youruser
26+
password: yourpass
27+
```
28+
29+
# Todo - auth configuration documentation.
30+
31+
See [.superstac.yml](./superstac/.superstac.yml) for an example configuration file.

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ description = "Add your description here"
55
readme = "README.md"
66
requires-python = ">=3.9"
77
dependencies = []
8+
9+
[tool.uv]
10+
dev-dependencies = [
11+
"ruff",
12+
]

ruff.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[lint]
2+
select = ["ALL"]

superstac/.superstac.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
catalogs:
2+
Earth Search:
3+
url: https://earth-search.aws.element84.com/v1
4+
Planetary Computer:
5+
url: https://planetarycomputer.microsoft.com/api/stac/v1

superstac/__init__.py

Whitespace-only changes.

superstac/catalog.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
class CatalogManager: ...

superstac/enums.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from enum import Enum
2+
3+
4+
class AuthType(str, Enum):
5+
BEARER = "bearer"
6+
BASIC = "basic"
7+
API_KEY = "apikey"

superstac/models.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
"""SuperSTAC Models."""
2+
3+
from __future__ import annotations
4+
5+
from typing import Optional
6+
from urllib.parse import urlparse
7+
8+
import attr
9+
10+
from superstac.enums import AuthType
11+
12+
13+
@attr.s(auto_attribs=True, kw_only=True)
14+
class AuthInfo:
15+
type: AuthType
16+
token: Optional[str] | None = None
17+
username: Optional[str] = None
18+
password: Optional[str] | None = None
19+
header_key: Optional[str] | None = None
20+
21+
22+
@attr.s(auto_attribs=True, kw_only=True)
23+
class CatalogEntry:
24+
"""_summary_.
25+
26+
Raises:
27+
ValueError: _description_
28+
29+
"""
30+
31+
name: str
32+
url: str = attr.ib(validator=attr.validators.instance_of(str))
33+
auth: Optional[AuthInfo] = None
34+
is_available: bool = False
35+
latency_ms: Optional[float] = None
36+
conforms_to: Optional[list[str]] = None
37+
collections: Optional[list[str]] = None
38+
extensions: Optional[list[str]] = None
39+
40+
@url.validator
41+
def _validate_url(self, _, value) -> None:
42+
result = urlparse(value)
43+
if not result.scheme.startswith("http"):
44+
msg = "Invalid URL: must start with http or https"
45+
raise ValueError(msg)

superstac/query.py

Whitespace-only changes.

uv.lock

Lines changed: 37 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)