Skip to content

Filtering, selection, and sorting

Filtering, property selection, and sorting are the same concepts whether you use the CLI (--filter, --properties) or the SDK (GetOptions). All of it happens client-side, after the API fetch.

A filter is path OP value. Multiple filters are combined with AND.

CLI — repeat --filter / -w:

Terminal window
katalogue field list --filter is_pii=true
katalogue field list --filter is_pii=true --filter field_type=TEXT
katalogue system list --filter 'system_name contains CRM'

SDK — pass a list of strings (or Filter objects) to GetOptions(filters=...):

client.get("field", GetOptions(filters=["is_pii=true"]))
client.get("field", GetOptions(filters=["is_pii=true", 'datatype_fullname="varchar"']))
OperatorMeaning
=Equals
!=Not equals
> < >= <=Numeric / ordinal comparison
containsSubstring match
startswithPrefix match
endswithSuffix match

String operators (=, contains, startswith, endswith) are case-insensitive. Boolean values are matched tolerantly: true and false match both the JSON boolean form and any casing of the string form ("true", "True", "TRUE").

Terminal window
katalogue field list --filter 'field_name startswith user_'

When fetching a hierarchy (--include-children / include_children=True), a dotted path scopes the filter to one level. Only records at that level are pruned; ancestors are retained.

client.get("system", GetOptions(
resource_id=1,
include_children=True,
filters=["field.is_pii=true"], # keep only PII fields, keep their parents
))
Terminal window
katalogue system get 1 --include-children --filter field.is_pii=true

Return only specific properties — useful for large responses or scripting.

Terminal window
katalogue system list --properties system_id,system_name
katalogue field list --properties field_name,is_pii --format json
client.get("system", GetOptions(properties=["system_id", "system_name"]))

In CLI table output, each resource has a default set of columns; pass --wide to show all properties, or --properties to choose your own. See Resources for the default columns per resource.

Multi-column sort via GetOptions(sort=...). "asc" / "desc" are case-insensitive; null values always sort last.

client.get("system", GetOptions(sort=[{"system_name": "asc"}]))
client.get("field", GetOptions(sort=[{"dataset_name": "asc"}, {"field_name": "asc"}]))

Filter and property names are the keys the API returns for your instance. Discover them with the keys command (CLI) or by inspecting result.data (SDK):

Terminal window
katalogue field keys # one key per line
katalogue dataset keys --format json

See Resources for the commonly used keys on each resource.