Full Class and Function docs

Baserow Client

class baserowapi.baserow.Baserow(url: str = 'https://api.baserow.io', token: str | None = None, batch_size: int = 10, timeout: float = 10, read_retries: int = 2)[source]

Bases: object

Client for Baserow’s database-token data API.

ERROR_MESSAGES: dict[int, str] = {400: 'Bad request to {url}. The request contains invalid values or the JSON could not be parsed.', 401: 'Unauthorized request to {url}. Accessing an endpoint without a valid database token.', 404: 'Resource not found at {url}. Row or table is not found.', 413: 'Request entity too large at {url}. The request exceeded the maximum allowed payload size.', 415: 'Unsupported media type in request at {url}.', 500: 'Internal server error at {url}. The server encountered an unexpected condition.', 502: 'Bad gateway at {url}. Baserow is restarting or an unexpected outage is in progress.', 503: 'Service unavailable at {url}. The server could not process your request in time.'}
get_table(table_id: int) Table[source]

Return a new Table for a positive integer ID.

The Table’s field schema is loaded lazily.

get_tables() list[Table][source]

Return every table visible to this database token.

make_api_request(endpoint: str, method: str = 'GET', data: Any = None, headers: Mapping[str, str] | None = None, timeout: float | None = None, files: Mapping[str, IO[bytes]] | None = None) Any[source]

Make one authenticated request and return its parsed response.

This is the low-level escape hatch for database-token endpoints not yet modeled by the package. It supplies authentication, timeout and safe read-retry behavior, package exceptions, and response parsing. It does not provide schema semantics or guarantee endpoint stability.

upload_file(file_path: str | Path) BaserowFile[source]

Upload one local file and return it without assigning it to a row.

upload_file_via_url(url: str) BaserowFile[source]

Ask Baserow to import one URL and return the unattached user file.

Exceptions

Exceptions raised by baserowapi.

exception baserowapi.exceptions.BaserowAPIError[source]

Bases: Exception

Base class for all exceptions intentionally raised by this package.

exception baserowapi.exceptions.BaserowConnectionError(message: str, *, method: str | None = None, url: str | None = None)[source]

Bases: BaserowRequestError

Raised when a connection to Baserow cannot be established.

exception baserowapi.exceptions.BaserowHTTPError(status_code: int, message: str, *, method: str | None = None, url: str | None = None, error_code: str | None = None, description: str | None = None)[source]

Bases: BaserowAPIError

Raised when Baserow returns a non-successful HTTP response.

exception baserowapi.exceptions.BaserowRequestError(message: str, *, method: str | None = None, url: str | None = None)[source]

Bases: BaserowAPIError

Raised when an API request cannot be completed.

exception baserowapi.exceptions.BaserowResponseError(message: str, *, method: str | None = None, url: str | None = None)[source]

Bases: BaserowAPIError

Raised when a Baserow response cannot be interpreted as advertised.

exception baserowapi.exceptions.BaserowTimeoutError(message: str, *, method: str | None = None, url: str | None = None)[source]

Bases: BaserowRequestError

Raised when an API request exceeds its timeout.

exception baserowapi.exceptions.FieldDataRetrievalError[source]

Bases: FieldError

Raised when data required by a field cannot be retrieved.

exception baserowapi.exceptions.FieldError[source]

Bases: BaserowAPIError

Base class for field-related errors.

exception baserowapi.exceptions.FieldValidationError[source]

Bases: FieldError

Raised when a field value fails validation.

exception baserowapi.exceptions.FieldValueError[source]

Bases: FieldError

Raised when an explicit field value conversion cannot be completed.

exception baserowapi.exceptions.FilterError[source]

Bases: BaserowAPIError

Base class for filter-related errors.

exception baserowapi.exceptions.InvalidFieldNameError[source]

Bases: FilterError

Raised when a filter field name is invalid.

exception baserowapi.exceptions.InvalidOperatorError[source]

Bases: FilterError

Raised when a filter operator is invalid.

exception baserowapi.exceptions.RowAddError(message: str, *, failed_batch_number: int | None = None, completed_row_ids: Iterable[int] = ())[source]

Bases: RowWriteError

Raised when adding rows fails.

exception baserowapi.exceptions.RowDeleteError(message: str, *, failed_batch_number: int | None = None, completed_row_ids: Iterable[int] = ())[source]

Bases: RowWriteError

Raised when deleting rows fails.

Batch deletion is not atomic. completed_row_ids identifies IDs sent in earlier request chunks that Baserow confirmed before the failed chunk.

exception baserowapi.exceptions.RowError[source]

Bases: BaserowAPIError

Base class for row operation errors.

exception baserowapi.exceptions.RowFetchError[source]

Bases: RowError

Raised when fetching rows fails.

exception baserowapi.exceptions.RowMoveError[source]

Bases: RowError

Raised when moving a row fails.

exception baserowapi.exceptions.RowUpdateError(message: str, *, failed_batch_number: int | None = None, completed_row_ids: Iterable[int] = ())[source]

Bases: RowWriteError

Raised when updating rows fails.

exception baserowapi.exceptions.RowWriteError(message: str, *, failed_batch_number: int | None = None, completed_row_ids: Iterable[int] = ())[source]

Bases: RowError

Base class for row mutation failures with optional batch progress.

Batch mutations are not atomic. When an earlier request chunk succeeded before a later chunk failed, completed_row_ids identifies the rows known to have been written and failed_batch_number identifies the one-based request chunk that failed.

Table

class baserowapi.models.table.Table(table_id: int, client: Baserow, table_data: Mapping[str, Any] | None = None)[source]

Bases: object

Represents a table in Baserow with functionalities to manipulate and query rows, fields, etc.

FIELD_TYPE_CLASS_MAP: Dict[str, type] = {'autonumber': <class 'baserowapi.models.fields.autonumber_field.AutonumberField'>, 'boolean': <class 'baserowapi.models.fields.boolean_field.BooleanField'>, 'count': <class 'baserowapi.models.fields.count_field.CountField'>, 'created_on': <class 'baserowapi.models.fields.created_on_field.CreatedOnField'>, 'date': <class 'baserowapi.models.fields.date_field.DateField'>, 'email': <class 'baserowapi.models.fields.email_field.EmailField'>, 'file': <class 'baserowapi.models.fields.file_field.FileField'>, 'formula': <class 'baserowapi.models.fields.formula_field.FormulaField'>, 'generic': <class 'baserowapi.models.fields.generic_field.GenericField'>, 'last_modified': <class 'baserowapi.models.fields.last_modified_field.LastModifiedField'>, 'link_row': <class 'baserowapi.models.fields.table_link_field.TableLinkField'>, 'long_text': <class 'baserowapi.models.fields.long_text_field.LongTextField'>, 'lookup': <class 'baserowapi.models.fields.lookup_field.LookupField'>, 'multiple_collaborators': <class 'baserowapi.models.fields.multiple_collaborators_field.MultipleCollaboratorsField'>, 'multiple_select': <class 'baserowapi.models.fields.multiple_select_field.MultipleSelectField'>, 'number': <class 'baserowapi.models.fields.number_field.NumberField'>, 'password': <class 'baserowapi.models.fields.password_field.PasswordField'>, 'phone_number': <class 'baserowapi.models.fields.phone_number_field.PhoneNumberField'>, 'rating': <class 'baserowapi.models.fields.rating_field.RatingField'>, 'single_select': <class 'baserowapi.models.fields.single_select_field.SingleSelectField'>, 'text': <class 'baserowapi.models.fields.text_field.TextField'>, 'url': <class 'baserowapi.models.fields.url_field.UrlField'>, 'uuid': <class 'baserowapi.models.fields.uuid_field.UUIDField'>}
add_row(values: Mapping[str, Any]) Row[source]

Add one row and return it.

add_rows(rows_data: List[Mapping[str, Any]], batch_size: int | None = None) List[Row][source]

Add multiple rows to the table.

Parameters:
  • rows_data (list[dict]) – A non-empty list of field-value mappings.

  • batch_size (int) – The number of rows to include in each batch request when adding multiple rows. Defaults to the client’s batch_size.

Returns:

The added rows in input order.

Return type:

list[Row]

Raises:
  • ValueError – If parameters are not valid.

  • RowAddError – If rows cannot be added or parsed.

delete_row(row_id: int | str) bool[source]

Delete one row by ID.

delete_rows(row_ids: List[str | int], batch_size: int | None = None) bool[source]

Delete a non-empty list of explicit row IDs in request chunks.

property field_names: List[str]

Retrieve the names of all fields in the table, sorted by field.order.

Returns:

A list of field names.

Return type:

List[str]

Raises:

FieldDataRetrievalError – If the table fields cannot be retrieved or parsed.

property fields: Mapping[str, Field]

Retrieve the fields associated with the table.

If the fields haven’t been fetched yet, this property sends an API request to retrieve them. Once retrieved, the fields are cached to avoid unnecessary API requests in subsequent calls. The hosted response must provide the stable metadata required to construct and order each Field; extra metadata and unknown non-empty field types are preserved.

Returns:

An ordered, read-only mapping from field name to Field.

Return type:

Mapping[str, Field]

Raises:

FieldDataRetrievalError – If the table fields cannot be retrieved or parsed.

get_row(row_id: int | str) Row[source]

Retrieve a specific row by its ID from the table.

Parameters:

row_id (int or str) – The unique identifier of the row to retrieve. This can be either an integer or a string that can be converted to an integer.

Returns:

An instance of the Row model representing the fetched row.

Return type:

Row

Raises:
  • ValueError – If the provided row_id is not valid or cannot be converted to an integer.

  • RowFetchError – If there’s any error during the API request or if the row is not found.

get_rows(include: List[str] | None = None, exclude: List[str] | None = None, search: str | None = None, order_by: List[str] | None = None, filter_type: str | None = None, filters: List[Filter] | None = None, view_id: int | None = None, size: int | None = None, limit: int | None = None) List[Row][source]

Retrieves rows from the table using provided parameters, with an optional limit on the number of rows.

Parameters:
  • include (list[str], optional) – A list of field names to include in the results.

  • exclude (list[str], optional) – A list of field names to exclude from the results.

  • search (str, optional) – A search string to apply on the table data.

  • order_by (list[str], optional) – Field by which the results should be ordered.

  • filter_type (str, optional) – The type of filter to be applied.

  • filters (list[Filter], optional) – A list containing Filter objects to be applied.

  • view_id (int, optional) – Positive integer ID of the view whose filters and sorts apply.

  • size (int, optional) – A positive integer number of rows per response page.

  • limit (int, optional) – A non-negative maximum number of rows; zero performs no request.

Returns:

A list of Row objects.

Return type:

list[Row]

Raises:
  • RowFetchError – If rows cannot be retrieved or parsed.

  • ValueError – If parameters are not valid.

iter_rows(include: List[str] | None = None, exclude: List[str] | None = None, search: str | None = None, order_by: List[str] | None = None, filter_type: str | None = None, filters: List[Filter] | None = None, view_id: int | None = None, size: int | None = None, limit: int | None = None) Iterator[Row][source]

Generator function to retrieve rows from the table in a paginated manner, optionally limiting the number of rows returned.

Parameters:
  • include (list[str], optional) – A list of field names to include in the results.

  • exclude (list[str], optional) – A list of field names to exclude from the results.

  • search (str, optional) – A search string to apply on the table data.

  • order_by (list[str], optional) – Field by which the results should be ordered.

  • filter_type (str, optional) – The type of filter to be applied.

  • filters (list[Filter], optional) – A list containing Filter objects to be applied.

  • view_id (int, optional) – Positive integer ID of the view whose filters and sorts apply.

  • size (int, optional) – A positive integer number of rows per response page.

  • limit (int, optional) – A non-negative maximum number of rows; zero performs no request.

Yield:

Yields Row objects as they are fetched, up to the specified limit.

Return type:

Iterator[Row]

Raises:
  • RowFetchError – If any error occurs during the process.

  • ValueError – If parameters are not valid.

move_row(row_id: int | str, before_id: str | int | None = None) Row[source]

Move one row before another row, or to the end when omitted.

property primary_field: str

Retrieve the primary field of the table.

If the primary field hasn’t been determined yet, this property will invoke the method to set it. Once set, the primary field is cached to avoid unnecessary computations in subsequent calls.

Returns:

The primary field of the table.

Return type:

str

update_row(row_id: int | str, values: Mapping[str, Any]) Row[source]

Update one row and return the server representation.

update_rows(rows_data: List[Mapping[str, Any]], batch_size: int | None = None) List[Row][source]

Updates multiple rows in the table using the Baserow batch update endpoint.

Parameters:
  • rows_data (list[dict]) – A list of dictionaries. Each dictionary should contain the field values for updating a specific row and include the ID of the row to be updated.

  • batch_size (int) – The number of rows to process in each batch.

Returns:

A list of Row objects representing the updated rows.

Return type:

list[Row]

Raises:
  • ValueError – If parameters are not valid.

  • KeyError – If a dictionary contains a key that doesn’t correspond to any writable field in the table or is missing the ‘id’ key.

  • TypeError – If an item in rows_data is not a mapping, or if a generator is passed.

  • RowUpdateError – If rows cannot be updated or parsed.

property writable_fields: Mapping[str, Field]

Retrieve the list of writable fields for the table.

This property lazily loads the fields using the fields property and then filters them to include only those fields where is_read_only is False.

Returns:

An ordered, read-only mapping of writable fields.

Return type:

Mapping[str, Field]

Fields

class baserowapi.models.fields.AutonumberField(name: str, field_data: Dict[str, Any], client=None)[source]

Bases: Field

A read-only Baserow-assigned row number.

TYPE = 'autonumber'
property is_read_only: bool

Determine if the field is read-only.

Returns:

True if the field is read-only, otherwise False.

Return type:

bool

class baserowapi.models.fields.BooleanField(name: str, field_data: Dict[str, Any], client=None)[source]

Bases: Field

Represents a boolean field in Baserow.

Variables:

TYPE (str) – The type of the field, which is ‘boolean’.

TYPE = 'boolean'
validate_value(value: bool) None[source]

Validate the value for a BooleanField.

Parameters:

value (bool) – The boolean value to be validated.

Raises:

FieldValidationError – If the value is not of boolean type.

class baserowapi.models.fields.CountField(name: str, field_data: Dict[str, Any], client=None)[source]

Bases: NumberField

A read-only relation count returned as a Baserow decimal string.

TYPE = 'count'
property formula_type: str | None
property is_read_only: bool

Determine if the field is read-only.

Returns:

True if the field is read-only, otherwise False.

Return type:

bool

property through_field_id: int | None
class baserowapi.models.fields.CreatedOnField(name: str, field_data: Dict[str, Any], client=None)[source]

Bases: BaseDateField

Represents a field in Baserow that indicates the creation date.

Variables:

TYPE (str) – The type of the field, which is ‘created_on’.

TYPE = 'created_on'
property is_read_only: bool

Determine if the CreatedOnField is read-only.

Returns:

True, as this field type is always read-only.

Return type:

bool

class baserowapi.models.fields.DateField(name: str, field_data: Dict[str, Any], client=None)[source]

Bases: BaseDateField

Represents a date-only field in Baserow.

Variables:

TYPE (str) – The type of the field, which is ‘date’.

TYPE = 'date'
class baserowapi.models.fields.EmailField(name: str, field_data: Dict[str, Any], client=None)[source]

Bases: BaseTextClass

Represents an email field in Baserow.

Variables:

TYPE (str) – The type of the field, which is ‘email’.

TYPE = 'email'
class baserowapi.models.fields.Field(name: str, field_data: Dict[str, Any], client=None)[source]

Bases: object

Represents a field in Baserow and provides methods to interact with its properties.

property compatible_filters: tuple[str, ...]

Return immutable advisory filter names documented for this Field.

decode_value(raw_value: Any) Any[source]

Decode a raw Baserow response value for ordinary row access.

Unknown and scalar values are lossless pass-through values unless a field subclass defines a Baserow-specific structured representation.

encode_value(value: Any) Any[source]

Validate and encode a caller value for the Baserow API.

filter_compatibility(operator: str) FilterCompatibility[source]

Return advisory compatibility without blocking unknown operators.

format_for_api(value: Any) Any[source]

Compatibility alias for encode_value().

Parameters:

value (Any) – The value to be formatted for the API.

Returns:

The formatted value.

Return type:

Any

property id: int | None

Retrieve the ID of the field.

Returns:

The ID of the field or None if not present.

Return type:

Union[int, None]

property is_primary: bool

Determine if the field is primary.

Returns:

True if the field is primary, otherwise False.

Return type:

bool

property is_read_only: bool

Determine if the field is read-only.

Returns:

True if the field is read-only, otherwise False.

Return type:

bool

property order: int | float | None

Retrieve the order of the field.

Returns:

The order of the field or None if not present.

Return type:

Union[int, float, None]

property table_id: int | None

Retrieve the table ID associated with the field.

Returns:

The table ID or None if not present.

Return type:

Union[int, None]

property type: str | None

Retrieve the type of the field.

Returns:

The type of the field or None if not present.

Return type:

Union[str, None]

validate_value(value: Any) None[source]

Validate the value against the field’s criteria.

Child classes can override for custom rules.

Parameters:

value (Any) – The value to be validated.

class baserowapi.models.fields.FileField(name: str, field_data: Dict[str, Any], client=None)[source]

Bases: Field

Baserow file-object and assignment semantics.

TYPE = 'file'
decode_value(raw_value: Any) list[BaserowFile][source]

Decode a raw Baserow response value for ordinary row access.

Unknown and scalar values are lossless pass-through values unless a field subclass defines a Baserow-specific structured representation.

encode_value(value: Any) Any[source]

Validate and encode a caller value for the Baserow API.

validate_value(value: Any) None[source]

Validate the value against the field’s criteria.

Child classes can override for custom rules.

Parameters:

value (Any) – The value to be validated.

class baserowapi.models.fields.FormulaField(name: str, field_data: Dict[str, Any], client=None)[source]

Bases: Field

Represents a field that computes its value based on a formula.

Variables:

TYPE (str) – The type of the field, which is ‘formula’.

TYPE = 'formula'
property array_formula_type: str | None

Retrieve the array formula type of the field.

Returns:

The array formula type of the field.

Return type:

Optional[str]

property error: str | None

Retrieve the error (if any) associated with the formula.

Returns:

The error associated with the formula.

Return type:

Optional[str]

property formula: str | None

Retrieve the formula of the field.

Returns:

The formula of the field.

Return type:

Optional[str]

property formula_type: str | None

Retrieve the formula type of the field.

Returns:

The formula type of the field.

Return type:

Optional[str]

property is_read_only: bool

Determine if the field is read-only.

Returns:

Always returns True for a FormulaField.

Return type:

bool

class baserowapi.models.fields.GenericField(name: str, field_data: Dict[str, Any], client=None)[source]

Bases: Field

Represents a generic field for unknown or unsupported field types in Baserow.

TYPE = 'generic'
filter_compatibility(operator: str) FilterCompatibility[source]

Unknown field types have no authoritative local filter knowledge.

class baserowapi.models.fields.LastModifiedField(name: str, field_data: Dict[str, Any], client=None)[source]

Bases: BaseDateField

Represents a field in Baserow that indicates the last modified date.

Variables:

TYPE (str) – The type of the field, which is ‘last_modified’.

TYPE = 'last_modified'
property is_read_only: bool

Determine if the LastModifiedField is read-only.

Returns:

True, as this field type is always read-only.

Return type:

bool

class baserowapi.models.fields.LongTextField(name: str, field_data: Dict[str, Any], client=None)[source]

Bases: BaseTextClass

Represents a long text field in Baserow.

Variables:

TYPE (str) – The type of the field, which is ‘long_text’.

TYPE = 'long_text'
property long_text_enable_rich_text: bool

Get the rich text enable status for this LongTextField.

Returns:

The rich text enable status.

Return type:

bool

property text_default: str

Get the default text value for this LongTextField.

Returns:

The default text value.

Return type:

str

class baserowapi.models.fields.LookupField(name: str, field_data: Dict[str, Any], client=None)[source]

Bases: Field

Baserow lookup metadata and identity-preserving result decoding.

TYPE = 'lookup'
property array_formula_type: str | None
decode_value(raw_value: Any) list[LookupEntry][source]

Decode a raw Baserow response value for ordinary row access.

Unknown and scalar values are lossless pass-through values unless a field subclass defines a Baserow-specific structured representation.

property formula_type: str | None
property is_read_only: bool

Determine if the field is read-only.

Returns:

True if the field is read-only, otherwise False.

Return type:

bool

property target_field_id: int | None
property target_field_name: str | None
property through_field_id: int | None
property through_field_name: str | None
class baserowapi.models.fields.MultipleCollaboratorsField(name: str, field_data: Dict[str, Any], client=None)[source]

Bases: Field

Baserow collaborator identity and assignment semantics.

TYPE = 'multiple_collaborators'
decode_value(raw_value: Any) list[Collaborator][source]

Decode a raw Baserow response value for ordinary row access.

Unknown and scalar values are lossless pass-through values unless a field subclass defines a Baserow-specific structured representation.

encode_value(value: Any) list[dict[str, int]][source]

Validate and encode a caller value for the Baserow API.

property notify_user_when_added: bool
validate_value(value: Any) None[source]

Validate the value against the field’s criteria.

Child classes can override for custom rules.

Parameters:

value (Any) – The value to be validated.

class baserowapi.models.fields.MultipleSelectField(name: str, field_data: dict[str, Any], client=None)[source]

Bases: Field

Baserow metadata and value semantics for a multiple-select field.

TYPE = 'multiple_select'
decode_value(raw_value: Any) list[SelectOption][source]

Decode a raw Baserow response value for ordinary row access.

Unknown and scalar values are lossless pass-through values unless a field subclass defines a Baserow-specific structured representation.

encode_value(value: Any) Any[source]

Validate and encode a caller value for the Baserow API.

property options: list[SelectOption]

Return the configured options without discarding IDs or metadata.

resolve_option(label: str) SelectOption[source]

Resolve one option by label, rejecting missing or duplicate labels.

validate_value(value: Any) None[source]

Validate the value against the field’s criteria.

Child classes can override for custom rules.

Parameters:

value (Any) – The value to be validated.

class baserowapi.models.fields.NumberField(name: str, field_data: Dict[str, Any], client=None)[source]

Bases: Field

Represents a number field in Baserow.

Variables:

TYPE (str) – The type of the field, which is ‘number’.

TYPE = 'number'
property allow_negative: bool

Determine if the NumberField allows negative numbers.

Returns:

True if negative numbers are allowed, else False.

Return type:

bool

property decimal_places: int

Get the number of decimal places allowed for this NumberField.

Returns:

The number of decimal places.

Return type:

int

validate_value(value: int | float | str) None[source]

Validate the value for a NumberField.

Parameters:

value (Union[int, float, str]) – The number value to be validated.

Raises:

FieldValidationError – If the value doesn’t match the expected type or constraints.

class baserowapi.models.fields.PasswordField(name: str, field_data: Dict[str, Any], client=None)[source]

Bases: Field

Represents a password field in Baserow.

Variables:

TYPE (str) – The type of the field, which is ‘password’.

TYPE = 'password'
decode_value(raw_value: Any) Any[source]

Preserve Baserow’s True or None password read state.

is_set(raw_value: Any) bool[source]

Return whether a hosted password read indicates a set password.

validate_value(value: Any) None[source]

Validate the value for a PasswordField. Ensure it’s a string, None, or True.

Parameters:

value (Any) – The value to be validated.

Raises:

FieldValidationError – If the value is not a string, None, or True.

class baserowapi.models.fields.PhoneNumberField(name: str, field_data: Dict[str, Any], client=None)[source]

Bases: Field

Represents a phone number field in Baserow.

Variables:

TYPE (str) – The type of the field, which is ‘phone_number’.

TYPE = 'phone_number'
validate_value(value: str) None[source]

Validate the value for a PhoneNumberField.

Phone numbers can have a maximum length of 100 characters consisting solely of digits, spaces, and the characters: Nx,._+*()#=;/-.

Parameters:

value (str) – The phone number string to be validated.

Raises:

FieldValidationError – If the phone number doesn’t match the expected format.

class baserowapi.models.fields.RatingField(name: str, field_data: Dict[str, Any], client=None)[source]

Bases: Field

Represents a rating field in Baserow.

Variables:

TYPE (str) – The type of the field, which is ‘rating’.

TYPE = 'rating'
validate_value(value: int) None[source]

Validate the value for a RatingField.

Parameters:

value (int) – The rating value to be validated.

Raises:

FieldValidationError – If the value doesn’t match the expected type or constraints.

class baserowapi.models.fields.SingleSelectField(name: str, field_data: dict[str, Any], client=None)[source]

Bases: Field

Baserow metadata and value semantics for a single-select field.

TYPE = 'single_select'
decode_value(raw_value: Any) SelectOption | None[source]

Decode a raw Baserow response value for ordinary row access.

Unknown and scalar values are lossless pass-through values unless a field subclass defines a Baserow-specific structured representation.

encode_value(value: Any) Any[source]

Validate and encode a caller value for the Baserow API.

property options: list[SelectOption]

Return the configured options without discarding IDs or metadata.

resolve_option(label: str) SelectOption[source]

Resolve one option by label, rejecting missing or duplicate labels.

validate_value(value: Any) None[source]

Validate the value against the field’s criteria.

Child classes can override for custom rules.

Parameters:

value (Any) – The value to be validated.

class baserowapi.models.fields.TableLinkField(name: str, field_data: Dict[str, Any], client=None)[source]

Bases: Field

Baserow metadata and complete-set semantics for a link-row field.

TYPE = 'link_row'
decode_value(raw_value: Any) list[LinkedRow][source]

Decode a raw Baserow response value for ordinary row access.

Unknown and scalar values are lossless pass-through values unless a field subclass defines a Baserow-specific structured representation.

encode_value(value: Any) Any[source]

Validate and encode a caller value for the Baserow API.

get_linked_rows() list[LinkedRow][source]

Return selectable related rows with their row IDs and display values.

property link_row_limit_selection_view_id: int | None
property link_row_related_field_id: int | None
property link_row_table_id: int | None
resolve_linked_row(label: Any) LinkedRow[source]

Resolve one related row by display label, rejecting ambiguity.

validate_value(value: Any) None[source]

Validate the value against the field’s criteria.

Child classes can override for custom rules.

Parameters:

value (Any) – The value to be validated.

class baserowapi.models.fields.TextField(name: str, field_data: Dict[str, Any], client=None)[source]

Bases: BaseTextClass

Represents a text field in Baserow.

Variables:

TYPE (str) – The type of the field, which is ‘text’.

TYPE = 'text'
property text_default: str

Get the default text value for this TextField.

Returns:

The default text value.

Return type:

str

class baserowapi.models.fields.UUIDField(name: str, field_data: Dict[str, Any], client=None)[source]

Bases: Field

A read-only persistent Baserow UUID.

TYPE = 'uuid'
property is_read_only: bool

Determine if the field is read-only.

Returns:

True if the field is read-only, otherwise False.

Return type:

bool

parse_value(value: Any) UUID[source]

Parse a returned UUID string without changing ordinary row reads.

class baserowapi.models.fields.UrlField(name: str, field_data: Dict[str, Any], client=None)[source]

Bases: BaseTextClass

Represents a URL field in Baserow.

Variables:

TYPE (str) – The type of the field, which is ‘url’.

TYPE = 'url'

Row

Baserow row model backed directly by Field semantics.

class baserowapi.models.row.Row(row_data: Mapping[str, Any], table: Table, client: Client)[source]

Bases: object

One Baserow row with decoded and raw field-value access.

delete() bool[source]

Delete this row through its Table.

move(before_id: str | int | None = None) Row[source]

Move this row through its Table and synchronize this object.

property raw_values: Mapping[str, Any]

Return a shallow read-only mapping of raw Baserow field values.

to_dict() dict[str, Any][source]

Return a mutable top-level copy of the decoded field values.

update(values: Mapping[str, Any]) Row[source]

Persist an explicit field-value mapping and synchronize this Row.

property values: Mapping[str, Any]

Return a shallow read-only mapping of Field-decoded values.

Structured Baserow Values

Small records that retain Baserow IDs and raw value metadata.

class baserowapi.models.values.BaserowFile(name: str, visible_name: str | None = None, url: str | None = None, size: int | None = None, mime_type: str | None = None, original_name: str | None = None, raw: dict[str, ~typing.Any]=<factory>)[source]

Bases: object

A Baserow user file that can be assigned to a file field.

mime_type: str | None
name: str
original_name: str | None
raw: dict[str, Any]
size: int | None
url: str | None
visible_name: str | None
class baserowapi.models.values.Collaborator(id: int, name: str | None = None, email: str | None = None, raw: dict[str, ~typing.Any]=<factory>)[source]

Bases: object

A Baserow collaborator value with its stable user ID.

email: str | None
id: int
name: str | None
raw: dict[str, Any]
class baserowapi.models.values.LinkedRow(table_id: int, id: int | None, value: Any = None, raw: dict[str, ~typing.Any]=<factory>)[source]

Bases: object

A reference to a row selected through a Baserow link-row field.

id: int | None
raw: dict[str, Any]
table_id: int
value: Any
class baserowapi.models.values.LookupEntry(row_id: int | None, value: Any, raw: Any = None)[source]

Bases: object

One Baserow lookup result and its related row ID, when supplied.

raw: Any
row_id: int | None
value: Any
class baserowapi.models.values.SelectOption(id: int | None, value: str | None, color: str | None = None, raw: dict[str, ~typing.Any]=<factory>)[source]

Bases: object

A Baserow select option, including its stable option ID.

color: str | None
id: int | None
raw: dict[str, Any]
value: str | None

Filter

class baserowapi.models.filter.Filter(field_name: str, value: Any, operator: str = 'equal')[source]

Bases: object

One structurally valid Baserow row filter.

class baserowapi.models.filter.FilterCompatibility(*values)[source]

Bases: str, Enum

The package’s advisory knowledge of a field/operator combination.

SUPPORTED = 'supported'
UNKNOWN = 'unknown'
UNSUPPORTED = 'unsupported'