Module qbandas.schemas
Methods that deal with handling local copies of QuickBase tables' schemas.
Everytime you want to upload or fetch records on QuickBase, you must have a valid schema for the table.
Arguments
Field arguments for the schema are used to tell qbandas how to parse
the incoming/outgoing data. You can set field arguments using
add_schema_args()
and set_schema_args()
.
For help creating datetime format strings, see here and here.
Field Type | Supported arguments |
---|---|
duration | unit : str, either 'seconds' or 'milliseconds' |
date | format : str, datetime format string |
datetime | format : str, datetime format string |
Functions
def add_schema_args(table_name: str, fields: list = None, arguments: dict = None, *fields_, **arguments_)
-
Add arguments to a table's schema
Will append to the schema and override any existing arguments with the same name
Parameters
table_name
:str
- The table to update
fields
:list
- The field names to update, by default None
arguments
:dict
- The arguments to add, by default None
def fetch_schema(dbid: str, profile: str, table_name: str = None)
-
Download a local copy of a table's structure from a QuickBase application.
Parameters
dbid
:str
- The unique identifier of the table in QuickBase.
profile
:str
- The profile to authorize this request
table_name
:str
, optional- The name of the table. None uses the dbid, by default None
def list_schemas() ‑> list[str]
-
List the names of all the usable schemas.
The names are 'table_names'
Returns
list[str]
- The names of all the usable schemas
def set_schema_args(table_name: str, fields: list = None, arguments: dict = None, *fields_, **arguments_)
-
Set the arguments for some fields in a given schema
Parameters
table_name
:str
- The nameof the table to configure
fields
:list
, optional- The fields to configure, by default None
arguments
:dict
, optional- The arguments to add, by default None