isogeo_pysdk.api.routes_account module

Isogeo API v1 - API Routes for Account entities

See: http://help.isogeo.com/api/complete/index.html

class isogeo_pysdk.api.routes_account.ApiAccount(api_client=None)

Bases: object

Routes as methods of Isogeo API used to manipulate account (user).

get(include=('_abilities',), caching=1)

Get authenticated user account(= profile) informations.

Parameters
  • include (tuple) – additional parts of model to include in response

  • caching (bool) – option to cache the response

Return type

User

memberships()

Returns memberships for the authenticated user.

Example

>>> my_groups = isogeo.account.memberships()
>>> print(len(my_groups))
10
>>> groups_where_iam_admin = list(filter(lambda d: d.get("role") == "admin", my_groups))
>>> print(len(groups_where_iam_admin))
5
>>> groups_where_iam_editor = list(filter(lambda d: d.get("role") == "editor", my_groups))
>>> print(len(groups_where_iam_editor))
4
>>> groups_where_iam_reader = list(filter(lambda d: d.get("role") == "reader", my_groups))
>>> print(len(groups_where_iam_reader))
1
Return type

list

update(account, caching=1)

Update authenticated user account(= profile) informations.

Parameters
  • account (class) – user account model object to update

  • caching (bool) – option to cache the response

Return type

User