Skip to content

Index

subsurfaceio.io

Fetch or pass through an external data source.

from subsurfaceio.io import resolve_source

payload = resolve_source('data.xlsx')

Functions:

Name Description
resolve_source

Return local bytes or fetch an HTTP(S) URL.

resolve_source

resolve_source(source: str | bytes) -> str | bytes

Return local bytes or fetch an HTTP(S) URL.

Parameters:

Name Type Description Default
source str | bytes

File path, raw bytes, or an HTTP(S) URL.

required

Returns:

Type Description
str | bytes

Unchanged source when it is not an HTTP(S) URL; otherwise the response body as bytes.

Raises:

Type Description
HTTPError

If the URL request fails.