Module qbandas.profiles

Manage qbandas profiles

Profiles control the authorization of all qbandas requests. Each profile contains some set of QuickBase API headers that can be configured using qbandas.set_profile().

Functions

def is_valid_profile(profile: str, talk: bool = False) ‑> bool

Check if a profile is usable

If a profile is usable, you will be able to make requests to the QuickBase API using it; however, these requests are not guaranteed to be authorized. If a profile doesn't exist, it is automaically invalid.

Parameters

profile : str
The name of the profile to check
talk : bool, optional
Whether to tell you what is wrong with the profile's headers, by default False

Returns

bool
the validity of the profile
def list_profiles() ‑> list[str]

List all the usable profiles

Profiles in this list are not guaranteed to authorize your requests.

Returns

list[str]
The names of all the profiles
def set_profile(profile: str, *, host: str = None, user: str = None, auth: str = None, temp_token: bool = False, auto_user: bool = True) ‑> None

Configure a profile

If no profile exists with the name profile, a new profile will be created. Unspecified arguments will not override existing profile information.

More information about QuickBase API headers can be found here, and more information about QuickBase API tokens can be found here.

Parameters

profile : str
The name of the profile to configure. You will use this name to reference this profile in all future calls.
host : str, optional
The QuickBase realm hostname. You only need the first part of the host. For example, you would just need 'demo' from 'demo.quickbase.com', by default None
user : str, optional
The name of the user agent. If not supplied, use auto_user to fill this in for you, by default None
auth : str, optional
The QuickBase API token. Just the token, you don't need the TEMP or USER specifier, by default None
temp_token : bool, optional
Specify if the API token is temporary, by default False
auto_user : bool, optional
Specify if this profile should automatically populate the user argument with profile, by default True