Skip to content

angee.resources.sources

Registry of resource source types.

A resource entry names its source by a manifest key — path for a local file, url for a remote one. The resources addon owns the source-type seam but registers only the local path source; an addon that owns outbound networking, angee.integrate, registers the url source, so resources itself stays free of any network concern. Each source declares how to normalize its manifest value and how to materialize an entry to a local file.

ResourceSource

python
@dataclass(frozen=True, slots=True)
class ResourceSource()

One resource source type, keyed by its manifest key (path/url).

key

The manifest key that selects this source in a resource declaration.

normalize

Return the stored source value from one raw manifest value.

materialize

Return the local file path for one entry, fetching/resolving as needed.

register_source

python
def register_source(source: ResourceSource) -> None

Register a resource source type, failing fast on a duplicate key.

source_keys

python
def source_keys() -> frozenset[str]

Return every registered source key.

get_source

python
def get_source(key: str) -> ResourceSource

Return the registered source for key, or raise with an install hint.

Released under the AGPL-3.0 License.