Skip to content

finprint.catalogue

module finprint

Thin HTTP client for apps/data (port 8108): read a catalogued dataset, publish an output with its recipe.

  • materialize: POST /v1/datasets/{id}:materialize with {"use": "transform"}. The reply carries columns, rows, fetch_record and access (the copy policy decides whether rows may be saved).
  • upload: POST /v1/datasets:upload with the CSV as content_b64 and the recipe as recipe.

The base URL comes from the argument, else UMP_DATA_URL, else http://localhost:8108; the principal from the argument or UMP_PRINCIPAL (sent as X-UMP-Principal). Errors come back as RFC 9457 problem details and are raised as CatalogueError. Pass an httpx.Client to reuse a connection (tests pass one with a mock transport).

class

class CatalogueError(Exception)

Fields

NameTypeDefaultDescription
statusstatus
codecode
problemproblem or {}
Methods and properties (1)

init constructor

CatalogueError(
self,
message: str,
*,
status: int | None = None,
code: str | None = None,
problem: dict[str, Any] | None = None,
) -> None

Source: packages/finprint/src/finprint/catalogue.py, line 25

function

def base_url(url: str | None = None) -> str

Source: packages/finprint/src/finprint/catalogue.py, line 34

function

def rows_to_frame(resp: dict[str, Any]) -> pd.DataFrame

The columns and rows of a materialize reply as a DataFrame (rows as lists or as dicts).

Source: packages/finprint/src/finprint/catalogue.py, line 73

function

def materialize(
dataset_id: str,
*,
use: str = 'transform',
url: str | None = None,
principal: str | None = None,
client: httpx.Client | None = None,
timeout: float = 60.0,
) -> dict[str, Any]

Source: packages/finprint/src/finprint/catalogue.py, line 82

function

def upload(
payload: dict[str, Any],
*,
url: str | None = None,
principal: str | None = None,
client: httpx.Client | None = None,
timeout: float = 60.0,
) -> dict[str, Any]

Source: packages/finprint/src/finprint/catalogue.py, line 88

NameTypeValueDescription
DEFAULT_BASE_URL'http://localhost:8108'
PRINCIPAL_HEADER'X-UMP-Principal'