furemcape.reporter package

Reports on issues in the issuedb.

class furemcape.reporter.Reporter(*args, **kwargs)

Bases: furemcape.shared.obj.BaseAttrObject

Reports on issues in issuedb.

DEFAULT_FIELDS = ['id', 'title', 'danger', 'at', 'system', 'session', 'ip', 'user', 'resource', 'action', 'error']
LOG = <Logger furemcape.reporter.reporter (WARNING)>
count(fields='', order='', limit=10, **kwargs)

Returns query object for executing count query.

Parameters
  • fields (list) – Ordered list of field names to group by (defaults to ‘count’).

  • order (list) – Ordered list of field names to order by (defaults to fields).

  • limit (int) – Maximum result groups to include (defaults to 10).

  • **kwargs (dict) – Filter args.

Returns

Peewee query object.

list(fields='', order='', limit=10, **kwargs)

Returns query object for executing list query.

Parameters
  • fields (list) – Ordered list of field names to query (defaults to DEFAULT_FIELDS).

  • order (list) – Ordered list of field names to order by (defaults to ‘-at,-id’).

  • limit (int) – Maximum result rows to include (defaults to 10).

  • **kwargs (dict) – Filter args.

Returns

Peewee query object.

load_config(path)

Replaces configuration with specified config file.

Parameters

path (str) – Path to config file.

validate_db()

Raises exception if db not available.

Raises
  • AttributeError – Database not initialized. # noqa: DAR402

  • DoesNotExist – Required migrations not run. # noqa: DAR402

write(rows, fields, as_format='', delimiter='', as_file=None)

Prints out the specified query rows and fields.

Parameters
  • rows (list) – List of peewee query rows.

  • fields (list) – Ordered list of field names to output.

  • as_format (str) – Output format (‘csv’, ‘json’, ‘jsonl’, or ‘table’).

  • delimiter (str) – CSV delimiter (defaults to ‘,’).

  • as_file – File handle to write to (defaults to stdout).

Submodules

furemcape.reporter.reporter module

Reports on issues in issuedb.

class furemcape.reporter.reporter.Reporter(*args, **kwargs)

Bases: furemcape.shared.obj.BaseAttrObject

Reports on issues in issuedb.

DEFAULT_FIELDS = ['id', 'title', 'danger', 'at', 'system', 'session', 'ip', 'user', 'resource', 'action', 'error']
LOG = <Logger furemcape.reporter.reporter (WARNING)>
count(fields='', order='', limit=10, **kwargs)

Returns query object for executing count query.

Parameters
  • fields (list) – Ordered list of field names to group by (defaults to ‘count’).

  • order (list) – Ordered list of field names to order by (defaults to fields).

  • limit (int) – Maximum result groups to include (defaults to 10).

  • **kwargs (dict) – Filter args.

Returns

Peewee query object.

list(fields='', order='', limit=10, **kwargs)

Returns query object for executing list query.

Parameters
  • fields (list) – Ordered list of field names to query (defaults to DEFAULT_FIELDS).

  • order (list) – Ordered list of field names to order by (defaults to ‘-at,-id’).

  • limit (int) – Maximum result rows to include (defaults to 10).

  • **kwargs (dict) – Filter args.

Returns

Peewee query object.

load_config(path)

Replaces configuration with specified config file.

Parameters

path (str) – Path to config file.

validate_db()

Raises exception if db not available.

Raises
  • AttributeError – Database not initialized. # noqa: DAR402

  • DoesNotExist – Required migrations not run. # noqa: DAR402

write(rows, fields, as_format='', delimiter='', as_file=None)

Prints out the specified query rows and fields.

Parameters
  • rows (list) – List of peewee query rows.

  • fields (list) – Ordered list of field names to output.

  • as_format (str) – Output format (‘csv’, ‘json’, ‘jsonl’, or ‘table’).

  • delimiter (str) – CSV delimiter (defaults to ‘,’).

  • as_file – File handle to write to (defaults to stdout).