Skip to content

Client without async

egms_client.sync

The archive without async/await, for scripts and notebooks.

:class:Archive has the methods of :class:~egms_client.client.EgmsArchive, blocking until each one is done::

from egms_client.sync import Archive

with Archive() as archive:
    print(archive.velocity_at(14.12, 40.83))

The async client runs on an event loop of its own, in a background thread. That is why it also works inside Jupyter, where a loop is already running and asyncio.run refuses to start another. The on_* callbacks of :meth:Archive.fetch are called from that thread.

Archive

:class:~egms_client.client.EgmsArchive, blocking.

Takes the same arguments. Use it as a context manager, or call :meth:close: it stops the background thread.

close

close() -> None

Close the HTTP client (if the archive opened it) and stop the thread.

releases

releases() -> list[str]

See :meth:EgmsArchive.releases.

levels

levels() -> list[str]

See :meth:EgmsArchive.levels.

bursts

bursts() -> list[str]

See :meth:EgmsArchive.bursts.

search

search(tile: Tile, component: Component, release: str) -> Search | None

See :meth:EgmsArchive.search.

find

find(query: Query) -> list[Search]

See :meth:EgmsArchive.find.

fetch

fetch(query: Query, directory: Path | None = None, *, keep: Iterable[Keep] = ('zip',), concurrency: int = MAX_DOWNLOADS, max_bytes: int | None = None, on_file: Callable[[Hit, list[Path]], None] | None = None, on_progress: Progress | None = None, on_plan: Callable[[list[Hit]], None] | None = None) -> list[Path]

See :meth:EgmsArchive.fetch. The callbacks run on the background thread.

fetch_tile

fetch_tile(tile: Tile, component: Component, release: str, directory: Path | None = None) -> Path | None

See :meth:EgmsArchive.fetch_tile.

velocity_at

velocity_at(lon: float, lat: float, component: Component = 'U', release: str | None = None, directory: Path | None = None) -> PointVelocity

See :meth:EgmsArchive.velocity_at.