4.7.4.5. Tables

Parsers for tables.

axonius_api_client.parsers.tables.tablize(value, err=None, fmt='simple', footer=True, **kwargs)[source]

Create a table string from a list of dictionaries.

Parameters
  • value (typing.List[dict]) – list to create table from

  • err (typing.Optional[str]) – error string to display at top of table

  • fmt (str) – table format to use

  • footer (bool) – include err at bottom too

Return type

str

axonius_api_client.parsers.tables.tablize_schemas(schemas, config=None, err=None, fmt='simple', footer=True, orig=True, orig_width=20)[source]

Create a table string for a set of config schemas.

Parameters
  • schemas (typing.List[dict]) – config schemas to create a table from

  • config (typing.Optional[dict]) – current config with keys that map to schema names

  • err (typing.Optional[str]) – error string to show at top

  • fmt (str) – table format to use

  • footer (bool) – show err at bottom too

  • orig (bool) – show original values in output too

  • orig_width (int) – column width to use for orig values

Return type

str

axonius_api_client.parsers.tables.tablize_adapters(adapters, err=None, fmt='simple', footer=True)[source]

Create a table string for a set of adapter schemas.

Parameters
  • adapters (typing.List[dict]) – adapter schemas to create a table from

  • err (typing.Optional[str]) – error string to show at top

  • fmt (str) – table format to use

  • footer (bool) – show err at bottom too

Return type

str

axonius_api_client.parsers.tables.tablize_cnxs(cnxs, err=None, fmt='simple', footer=True)[source]

Create a table string for a set of adapter connection schemas.

Parameters
  • cnxs (typing.List[dict]) – connection schemas to create a table from

  • err (typing.Optional[str]) – error string to show at top

  • fmt (str) – table format to use

  • footer (bool) – show err at bottom too

Return type

str

axonius_api_client.parsers.tables.tablize_users(users, err, fmt='simple', footer=True)[source]

Create a table string for a set of users.

Parameters
  • users (typing.List[dict]) – users to create a table from

  • err (str) – error string to show at top

  • fmt (str) – table format to use

  • footer (bool) – show err at bottom too

Return type

str

axonius_api_client.parsers.tables.tablize_user(user)[source]

Create a table entry for a user.

Parameters

user (dict) – user to create a table entry for

Return type

dict

axonius_api_client.parsers.tables.tablize_roles(roles, cat_actions, err, fmt='simple', footer=True)[source]

Create a table string for a set of roles.

Parameters
  • roles (typing.List[dict]) – roles to create a table from

  • cat_actions (dict) – category -> actions mapping

  • err (str) – error string to show at top

  • fmt (str) – table format to use

  • footer (bool) – show err at bottom too

Return type

str

axonius_api_client.parsers.tables.tablize_role(role, cat_actions)[source]

Create a table entry for a role.

Parameters
  • role (dict) – role to create a table entry for

  • cat_actions (dict) – category -> actions mapping

Return type

dict

axonius_api_client.parsers.tables.tab_map(value, key_map, orig=False, orig_width=20)[source]

Create a new schema that has columns in a table friendly output format.

Parameters
  • value (dict) – schema to parse

  • key_map (typing.List[typing.List[typing.Union[str, int]]]) – key map containing key name -> column title -> column width

  • orig (bool) – include values from original schema not in key map

  • orig_width (int) – default column width to use for values from original schema

Return type

dict