Version: dev

This is the documentation for the development version. For the latest release, see v0.3.0.

esm_template

Stable type · Other

Tier: stable · Kind: type · Topic: Other

PythonJuliaRust
EsmTemplateEsmTemplatenot exported

Python

class EsmTemplate
EsmTemplate(template: str, substitutions: Mapping[str, str] = dict())
EsmTemplate.__call__(anchor: _dt.datetime) -> str
EsmTemplate.check_mirrors(mirrors: Sequence[str]) -> None
EsmTemplate.expand_mirrors(mirrors: Sequence[str], anchor: _dt.datetime) -> list[str]

A loader URL that is an esm template (spec/esm-sources.md §1.5).

Use it as DataSource url; give mirrors as esm templates too and they are expanded at the same anchor with the same substitutions. Calling it expands the template at an anchor.

Members

  • check_mirrors — Refuse a mirror template with an unbound or malformed name, as the primary is refused at construction.
  • expand_mirrors — Each mirror template expanded at anchor.

Source

Julia

struct EsmTemplate <: Function
EsmTemplate(template::AbstractString; substitutions, mirrors)
EsmTemplate(template; substitutions=Dict(), mirrors=String[])

A provider URL that is an esm template (spec/esm-sources.md §1.5). Pass it as the url of a Provider : it is called with a Unix-seconds file anchor and returns the expanded URL. Its mirrors are esm templates expanded at the same anchor with the same substitutions and tried in order after the primary URL. An unbound substitution is refused here, not at the first fetch.

Source

Rust

Rust does not export this type.