Skip to content

Client

Class BaseClient

class BaseClient()

[view_source]

Base class for the Baserow client which handles the authentication and request session.

A JWT is needed when performing requests that are scoped to user interactions (e.g. operations that are expected to be run through the UI). A token should be used if only a subset of the Baserow API is used to create/read/write/delete rows.

Class BaserowClient

class BaserowClient(BaseClient)

[view_source]

Client for Baserow servers.

login

def login(username: str,
          password: str,
          cache: t.Union[bool, str] = False) -> User

[view_source]

A convenience method to log into Baserow using the specified username and password and updating the current client object. If cache is enabled or is a filename, it will be used to load a cached token for the Baserow URL and username combination to reuse a previously generated JWT. If the reused JWT is not valid anymore, the credentials will be used to generate a new one.

load

def load(username: str,
         filename: t.Optional[str] = None,
         raise_: bool = False,
         refresh: bool = True) -> t.Optional[User]

[view_source]

Loads an existing JWT from the given filename or the DEFAULT_CREDENTIALS_FILE. Returns True if a token was loaded, False otherwise. If a token is loaded, it will be immediately refreshed.

save

def save(username: str, filename: t.Optional[str] = None) -> None

[view_source]

Saves the JWt of the client into filename or the given DEFAULT_CREDENTIALS_FILE.