Skip to content

Commit ea02946

Browse files
committed
chore: added logo closing #23
1 parent 5845510 commit ea02946

34 files changed

Lines changed: 477 additions & 229 deletions

‎Cargo.lock‎

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

‎Cargo.toml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ members = [
66
"crates/search",
77
"crates/engine",
88
"crates/cli",
9+
"crates/python",
910
]
1011

1112
[workspace.package]
1213
version = "0.1.0"
1314
edition = "2021"
14-
rust-version = "1.75"
15+
rust-version = "1.88"
1516
license = "MIT"
1617
repository = "https://github.com/spatialnode/superstac"
1718
homepage = "https://github.com/spatialnode/superstac"

‎README.md‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
# superstac
1+
# SuperSTAC
22

33
[![License](https://img.shields.io/badge/license-MIT-green.svg)](./LICENSE)
44
[![crates.io](https://img.shields.io/crates/v/superstac-search.svg)](https://crates.io/crates/superstac-search)
55
[![docs.rs](https://docs.rs/superstac-core/badge.svg)](https://docs.rs/superstac-search)
66

7+
8+
<picture>
9+
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/superstac-logo-dark.svg">
10+
<source media="(prefers-color-scheme: light)" srcset="docs/assets/superstac-logo.svg">
11+
<img src="docs/assets/superstac-logo.svg" alt="SuperSTAC logo" width="480">
12+
</picture>
13+
714
Federated [STAC](https://stacspec.org/) search across multiple catalogs. Query
815
Element84, Microsoft Planetary Computer, and others through one API.
916
Items come back deduplicated, with their collection IDs and asset keys
@@ -20,7 +27,7 @@ A single STAC catalog isn't always enough:
2027
- The catalog you usually use is down or rate-limited.
2128
- Different providers index the same scenes under different names.
2229

23-
superstac queries every catalog you've registered, drops the ones that don't
30+
SuperSTAC queries every catalog you've registered, drops the ones that don't
2431
serve the requested collection, runs the rest concurrently with retry and
2532
timeouts, then merges and dedupes the results.
2633

@@ -165,11 +172,10 @@ Some things on the way:
165172

166173
- Authentication (per-catalog headers, OAuth, API keys)
167174
- SQLite + Postgres backends
168-
- Python bindings via PyO3
169175
- and many more.
170176

171177
## License
172178

173179
MIT. See [LICENSE](./LICENSE).
174180

175-
Feedback and issues welcome — this is early. If you try it and you see any bug, feel free to open an issue!
181+
Feedback and issues welcome — this is early. If you try it and you see any bug, feel free to open an issue!

‎crates/cli/src/main.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use tracing_subscriber::EnvFilter;
1313
#[derive(Parser)]
1414
#[command(name = "superstac", version, about, long_about = None)]
1515
struct Cli {
16-
/// Path to the superstac config file.
16+
/// Path to the SuperSTAC config file.
1717
#[arg(long, default_value = "superstac.yml", global = true)]
1818
config: PathBuf,
1919

‎crates/config/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "superstac-config"
3-
description = "YAML config loading for superstac federated STAC search."
3+
description = "YAML config loading for SuperSTAC federated STAC search."
44
keywords = ["stac", "geospatial", "config"]
55
categories = ["science::geo", "config"]
66
readme = "../../README.md"

‎crates/config/src/config.rs‎

Lines changed: 115 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,125 @@
1+
use std::collections::HashMap;
2+
13
use serde::Deserialize;
24

3-
use superstac_core::models::{
4-
catalog::CatalogConfig,
5-
provider::CatalogProviderConfig,
5+
use superstac_core::{errors::{SuperSTACError, ValidationError}, models::{
6+
catalog::{Catalog, CatalogSettings, get_default_health_status},
7+
provider::CatalogProvider,
68
settings::Settings,
7-
};
9+
}, utils::{get_date_time, parse_url, validate_identifier}};
10+
811

9-
/// Configuration for SuperSTAC, Spatial Temporal Asset Catalog services
12+
/// Configuration for SuperSTAC.
1013
#[derive(Debug, Deserialize)]
1114
pub struct SuperStacConfig {
1215
pub catalogs: Vec<CatalogConfig>,
1316
pub providers: Vec<CatalogProviderConfig>,
1417
pub settings: Settings,
1518
}
19+
20+
21+
22+
/// A data structure for a STAC catalog from the YAML file.
23+
#[derive(Debug, Deserialize)]
24+
pub struct CatalogConfig {
25+
pub id: String,
26+
pub provider: Option<String>,
27+
pub title: Option<String>,
28+
pub url: Option<String>,
29+
pub description: Option<String>,
30+
pub settings: Option<CatalogSettings>,
31+
/// Maps canonical collection IDs to this catalog's local collection IDs.
32+
/// E.g. `sentinel-2-l2a: S2MSI2A` on a CDSE-style catalog.
33+
pub collection_aliases: Option<HashMap<String, String>>,
34+
/// Per-collection asset rename rules, keyed by canonical collection ID.
35+
/// Inner map: canonical asset key -> this catalog's local asset key.
36+
/// E.g. `{ "sentinel-2-l2a": { "blue": "B02", "green": "B03" } }`.
37+
pub asset_aliases: Option<HashMap<String, HashMap<String, String>>>,
38+
}
39+
40+
impl TryFrom<CatalogConfig> for Catalog {
41+
type Error = SuperSTACError;
42+
43+
fn try_from(cfg: CatalogConfig) -> Result<Self, Self::Error> {
44+
validate_identifier(&cfg.id)?;
45+
46+
let url = match cfg.url {
47+
Some(w) => {
48+
parse_url(&w).map_err(|e| ValidationError::InvalidUrl(e.to_string()))?;
49+
Some(w)
50+
}
51+
None => None,
52+
};
53+
54+
Ok(Self {
55+
id: cfg.id,
56+
provider: None,
57+
title: cfg.title,
58+
url: url.clone().unwrap(),
59+
description: cfg.description,
60+
settings: cfg.settings.unwrap_or(CatalogSettings::default()),
61+
health_status: get_default_health_status(url.unwrap()),
62+
capabilities: None,
63+
collection_aliases: cfg.collection_aliases.unwrap_or_default(),
64+
asset_aliases: cfg.asset_aliases.unwrap_or_default(),
65+
supported_collections: None,
66+
created_at: Some(get_date_time()),
67+
updated_at: None,
68+
})
69+
}
70+
}
71+
72+
73+
/// YAML-deserialization shape for a provider entry. Converted to
74+
/// [`CatalogProvider`] via `TryFrom`.
75+
#[derive(Debug, Deserialize)]
76+
pub struct CatalogProviderConfig {
77+
pub id: String,
78+
pub name: Option<String>,
79+
pub description: Option<String>,
80+
pub logo_url: Option<String>,
81+
pub website_url: Option<String>,
82+
// Disabling this for now, because it's probably better to have it in the catalog.
83+
// pub stac_version: Option<String>,
84+
pub catalog_ids: Option<Vec<String>>,
85+
}
86+
87+
impl TryFrom<CatalogProviderConfig> for CatalogProvider {
88+
type Error = SuperSTACError;
89+
90+
fn try_from(cfg: CatalogProviderConfig) -> Result<Self, Self::Error> {
91+
validate_identifier(&cfg.id)?;
92+
93+
let website_url = match cfg.website_url {
94+
Some(w) => {
95+
parse_url(&w).map_err(|e| ValidationError::InvalidUrl(e.to_string()))?;
96+
Some(w)
97+
}
98+
None => None,
99+
};
100+
101+
let logo_url = match cfg.logo_url {
102+
Some(l) => {
103+
parse_url(&l).map_err(|e| ValidationError::InvalidUrl(e.to_string()))?;
104+
Some(l)
105+
}
106+
None => None,
107+
};
108+
109+
// let stac_version = cfg
110+
// .stac_version
111+
// .ok_or_else(|| ValidationError::MissingField("stac_version".into()))?;
112+
113+
Ok(Self {
114+
id: cfg.id,
115+
name: cfg.name,
116+
description: cfg.description,
117+
website_url,
118+
logo_url,
119+
// stac_version: Some(stac_version),
120+
catalog_ids: None,
121+
created_at: Some(get_date_time()),
122+
updated_at: None,
123+
})
124+
}
125+
}

‎crates/config/src/lib.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Config-file loading for superstac. Reads `superstac.yml` and seeds a
1+
//! Config-file loading for SuperSTAC. Reads `superstac.yml` and seeds a
22
//! storage backend with providers, catalogs, and settings.
33
44
pub mod config;

0 commit comments

Comments
 (0)