Skip to content

Entities

Entity-related functionality is accessed through client.entities. For example:

from pyodk.client import Client

client = Client()
data = client.entities.list()

Conceptually, an Entity's parent object is an EntityList. Each EntityList may have multiple Entities. In Python parlance, EntityLists are like classes, while Entities are like instances.

create(label, data, entity_list_name=None, project_id=None, uuid=None)

Create an Entity.

Parameters:

Name Type Description Default
label str

Label of the Entity.

required
data dict

Data to store for the Entity.

required
entity_list_name str | None

The name of the Entity List (Dataset) being referenced.

None
project_id int | None

The id of the project this form belongs to.

None
uuid str | None

An optional unique identifier for the Entity. If not provided then a uuid will be generated and sent by the client.

None

get_table(entity_list_name=None, project_id=None, skip=None, top=None, count=None, filter=None, select=None)

Read Entity List data.

Parameters:

Name Type Description Default
entity_list_name str | None

The name of the Entity List (Dataset) being referenced.

None
project_id int | None

The id of the project this form belongs to.

None
skip int | None

The first n rows will be omitted from the results.

None
top int | None

Only up to n rows will be returned in the results.

None
count bool | None

If True, an @odata.count property will be added to the result to indicate the total number of rows, ignoring the above paging parameters.

None
filter str | None

Filter responses to those matching the query. Only certain fields are available to reference. The operators lt, le, eq, neq, ge, gt, not, and, and or are supported, and the built-in functions now, year, month, day, hour, minute, second.

None
select str | None

If provided, will return only the selected fields.

None

Returns:

Type Description
dict

A dictionary representation of the OData JSON document.

list(entity_list_name=None, project_id=None)

Read all Entity metadata.

Parameters:

Name Type Description Default
entity_list_name str | None

The name of the Entity List (Dataset) being referenced.

None
project_id int | None

The id of the project the Entity belongs to.

None

Returns:

Type Description
list[Entity]

A list of the object representation of all Entity metadata.

update(uuid, entity_list_name=None, project_id=None, label=None, data=None, force=None, base_version=None)

Update an Entity.

Parameters:

Name Type Description Default
uuid str

The unique identifier for the Entity.

required
label str | None

Label of the Entity.

None
data dict | None

Data to store for the Entity.

None
force bool | None

If True, update an Entity regardless of its current state. If base_version is not specified, then force must be True.

None
base_version int | None

The expected current version of the Entity on the server. If force is not True, then base_version must be specified.

None
entity_list_name str | None

The name of the Entity List (Dataset) being referenced.

None
project_id int | None

The id of the project this form belongs to.

None