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}:materializewith{"use": "transform"}. The reply carriescolumns,rows,fetch_recordandaccess(the copy policy decides whether rows may be saved).upload:POST /v1/datasets:uploadwith the CSV ascontent_b64and the recipe asrecipe.
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).
Classes
Section titled “Classes”CatalogueError
Section titled “CatalogueError”class
class CatalogueError(Exception)Fields
| Name | Type | Default | Description |
|---|---|---|---|
status | status | ||
code | code | ||
problem | problem 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,) -> NoneSource: packages/finprint/src/finprint/catalogue.py, line 25
Functions
Section titled “Functions”base_url
Section titled “base_url”function
def base_url(url: str | None = None) -> strSource: packages/finprint/src/finprint/catalogue.py, line 34
rows_to_frame
Section titled “rows_to_frame”function
def rows_to_frame(resp: dict[str, Any]) -> pd.DataFrameThe 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
materialize
Section titled “materialize”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
upload
Section titled “upload”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
Constants
Section titled “Constants”| Name | Type | Value | Description |
|---|---|---|---|
DEFAULT_BASE_URL | 'http://localhost:8108' | ||
PRINCIPAL_HEADER | 'X-UMP-Principal' |