Module qbandas.records
Functions that deal with sending records or information to a Quickbase application.
Functions
def fetch_records(table_name: str, profile: str, *columns_, columns: list[str] = None, where: str = None, order: list = None, group_by: list = None, skip: int = 0, limit: int = None) ‑> pandas.core.frame.DataFrame
-
Fetch a table of records from a QuickBase app
This method emulates the functionality of a SQL statement.
More information about fetching records through the QuickBase API can be found here.
Using this method without specifying
-O
to the python interpreter will print debug info. It can be useful for seeing if the data is being fetched correctly.Parameters
table_name
:str
- The table to pull records from
profile
:str
- The name of the profile to authorize this request
columns
:list[str]
, optional- The columns to select, by default None
*columns_
:list[str]
, optional- More columns to select, by default list()
where
:str
, optional- Should be written like an SQL statement, by default None
order
:list
, optional- The order in which to sort the returned records. Each entry in this list is a tuple with the first element being the column name, and the second is the word 'asc' or 'desc'. by default None
group_by
:list
, optional- How to group records, by default None
skip
:int
, optional- Number of records to skip off the top off the returned dataframe, by default 0
limit
:int
, optional- Maximum number of records that can be returned. None is no limit, by default None
Returns
pd.DataFrame
- The records from QuickBase.
def upload_records(df: pandas.core.frame.DataFrame, table_name: str, profile: str, drop: bool = False)
-
Send a table of records (rows) to a table on QuickBase.
If no errors are thrown, the data was successfully uploaded to QuickBase. If an error occurs when sending the data, it is possible that only some of your records will have been uploaded to QuickBase. If that is an issue, please fix the data, and send it all again.
Using this method without specifying
-O
to the python interpreter will print debug info. It can be useful for seeing if the data is being uploaded correctly.Parameters
df
:pd.DataFrame
- The table of records
table_name
:str
- Identifies which table to send the data to. You should use
fetch_schema()
to create atable_name
. profile
:str
- The profile to authorize this request
drop
:bool
, optional- Toggle dropping extra columns. If False, all columns must match, by deafult False