Log

The Log module provides functionality for working with logs.

class Log(api, log_id, data={})[source]

Bases: Base

Parameters:
BASE_ENDPOINT = 'logs/'
__init__(api, log_id, data={})[source]

Constructs all the necessary attributes for the Log object.

Parameters:
  • api (GeoboxClient) – The GeoboxClient instance for making requests.

  • log_id (int) – The id of the log.

  • data (Dict, optional) – The data of the log.

__repr__()[source]

Return a string representation of the Log object.

Returns:

A string representation of the Log object.

Return type:

str

classmethod get_logs(api, **kwargs)[source]

Get a list of Logs

Parameters:

api (GeoboxClient) – The GeoboxClient instance for making requests.

Keyword Arguments:
  • search (str) – search term for keyword-based searching among all textual fields

  • order_by (str) – comma separated list of fields for sorting results [field1 A|D, field2 A|D, …]. e.g. name A, type D. NOTE: “A” denotes ascending order and “D” denotes descending order.

  • skip (int) – Number of items to skip. default is 0.

  • limit (int) – Number of items to return. default is 10.

  • user_id (int) – Specific user. Privileges required.

  • from_date (datetime) – datetime object in this format: “%Y-%m-%dT%H:%M:%S.%f”.

  • to_date (datetime) – datetime object in this format: “%Y-%m-%dT%H:%M:%S.%f”.

  • user_identity (str) – the user identity in this format: username - firstname lastname - email .

  • activity_type (str) – the user activity type.

Returns:

a list of logs

Return type:

List[Log]

Example

>>> from geobox import GeoboxClient
>>> from geopox.log import Log
>>> client = GeoboxClient()
>>> logs = Log.get_logs(client)
or
>>> logs = client.get_logs()
delete()[source]

Delete a log (privileges required)

Returns:

None

Return type:

None

Example

>>> from geobox import GeoboxClient
>>> from geopox.log import Log
>>> client = GeoboxClient()
>>> log = Log.get_logs(client)[0]
>>> log.delete()
property user: User | None

Get the owner user for the log

Returns:

if the log has owner user

Return type:

User | None

Example

>>> from geobox import GeoboxClient
>>> from geopox.log import Log
>>> client = GeoboxClient()
>>> log = Log.get_logs(client)[0]
>>> log.user