fused.api
Module Functions
The following functions can be called directly from the fused.api module:
import fused.api
fused.api.function_name()
access_token
access_token() -> str
Get an access token for the Fused service.
airtable_connect
airtable_connect(*, base_id: str | None = None) -> FusedAirtableConnection
Create an Airtable connection using Fused-managed OAuth.
Parameters:
- base_id (
str | None) – Default Airtable base ID (e.g."appXXXXXXXXXXXXXX"). When provided, methods that accept abase_idparameter will fall back to this value.
Returns:
- A (
[FusedAirtableConnection](#fused.api._airtable.FusedAirtableConnection)) – class:FusedAirtableConnectioninstance.
airtable_list_records
airtable_list_records(table: str, *, base_id: str, **params: Any) -> list[dict]
List records from an Airtable table.
This is a convenience wrapper around
:meth:FusedAirtableConnection.list_records.
Parameters:
- table (
str) – Table name or ID. - base_id (
str) – Airtable base ID. - **params (
Any) – Extra query parameters forwarded to the Airtable List Records endpoint (e.g.maxRecords,view,filterByFormula).
Returns:
[list](#fused.api._public_api.list)\[[dict](#dict)\]– A list of record dicts.
anthropic_connect
anthropic_connect() -> anthropic.Anthropic
Return an authenticated Anthropic client for Claude model inference.
The API key is read from fused.secrets["ANTHROPIC_API_KEY"].
auth_scheme
auth_scheme() -> str
delete
delete(path: str, max_deletion_depth: int | Literal['unlimited'] = 3) -> bool
Delete the files at the path.
Parameters:
- path (
str) – Directory or file to delete, likefd://my-old-table/ - max_deletion_depth (
int | Literal['unlimited']) – If set (defaults to 3), the maximum depth the operation will recurse to. This option is to help avoid accidentally deleting more data that intended. Pass"unlimited"for unlimited.
Examples:
fused.api.delete("fd://bucket-name/deprecated_table/")
download
download(path: str, local_path: str | Path) -> None
Download the contents at the path to disk.
Parameters:
- path (
str) – URL to a file, likefd://bucket-name/file.parquet - local_path (
str | Path) – Path to a local file.
enable_gcs
enable_gcs()
Save gcs credentials from AWS secret manager into a temporary local file and set its path to the env variable.
get
get(path: str) -> bytes
Download the contents at the path to memory.
Parameters:
- path (
str) – URL to a file, likefd://bucket-name/file.parquet
Returns:
[bytes](#bytes)– bytes of the file
Examples:
fused.api.get("fd://bucket-name/file.parquet")
get_apps
get_apps(
n: int | None = None,
*,
skip: int = 0,
by: Literal["name", "id", "slug"] = "name",
whose: Literal["self", "public"] = "self"
) -> dict
Fetches a list of apps.
Parameters:
- n (
int | None) – The total number of UDFs to fetch. Defaults to All. - skip (
int) – The number of UDFs to skip before starting to collect the result set. Defaults to 0. - by (
Literal['name', 'id', 'slug']) – The attribute by which to sort the apps. Can be "name", "id", or "slug". Defaults to "name". - whose (
Literal['self', 'public']) – Specifies whose apps to fetch. Can be "self" for the user's own apps or "public" for UDFs available publicly. Defaults to "self".
Returns:
[dict](#dict)– A list of apps.
Examples:
Fetch apps under the user account:
fused.api.get_apps()
get_udfs
get_udfs(
n: int | None = None,
*,
skip: int = 0,
by: Literal["name", "id", "slug"] = "name",
whose: Literal["self", "public", "community", "team"] = "self",
collection_name: str | None = None
) -> dict
Fetches a list of UDFs.
Parameters:
- n (
int | None) – The total number of UDFs to fetch. Defaults to All. - skip (
int) – The number of UDFs to skip before starting to collect the result set. Defaults to 0. - by (
Literal['name', 'id', 'slug']) – The attribute by which to sort the UDFs. Can be "name", "id", or "slug". Defaults to "name". - whose (
Literal['self', 'public', 'community', 'team']) – Specifies whose UDFs to fetch. Can be "self" for the user's own UDFs or "public" for UDFs available publicly or "community" for all community UDFs. Defaults to "self". - collection_name (
str | None) – Filter UDFs by collection name. If not provided, defaults to "default".
Returns:
[dict](#dict)– A list of UDFs.
Examples:
Fetch UDFs under the user account:
fused.api.get_udfs()
hubspot_connect
hubspot_connect()
Create a HubSpot client using Fused-managed OAuth.
Returns an official hubspot.HubSpot client instance initialized
with a short-lived access token. See the hubspot-api-client docs for
the full API surface.
huggingface_connect
huggingface_connect() -> HfApi
Return an authenticated HfApi client for repos, models, and datasets.
The token is read from fused.secrets["HUGGINGFACE_API_KEY"].
huggingface_inference
huggingface_inference() -> InferenceClient
Return an authenticated InferenceClient for model inference.
The token is read from fused.secrets["HUGGINGFACE_API_KEY"].
job_cancel
job_cancel(job: CoerceableToJobId) -> RunResponse
Cancel an existing job
Parameters:
- job (
CoerceableToJobId) – the identifier of a job or aRunResponseobject.
Returns:
[RunResponse](#fused.models.internal.job.RunResponse)– A new job object.
job_get_exec_time
job_get_exec_time(job: CoerceableToJobId) -> timedelta
Determine the execution time of this job, using the logs.
Returns:
[timedelta](#datetime.timedelta)– Time the job took. If the job is in progress, time from first to last log message is returned.
job_get_logs
job_get_logs(job: CoerceableToJobId, since_ms: int | None = None) -> list[Any]
Fetch logs for a job
Parameters:
- job (
CoerceableToJobId) – the identifier of a job or aRunResponseobject. - since_ms (
int | None) – Timestamp, in milliseconds since epoch, to get logs for. Defaults to None for all logs.
Returns:
[list](#fused.api._public_api.list)\[[Any](#typing.Any)\]– Log messages for the given job.
job_get_results
job_get_results(job: CoerceableToJobId) -> list[Any]
job_get_status
job_get_status(job: CoerceableToJobId) -> RunResponse
Fetch the status of a running job
Parameters:
- job (
CoerceableToJobId) – the identifier of a job or aRunResponseobject.
Returns:
[RunResponse](#fused.models.internal.job.RunResponse)– The status of the given job.
job_print_logs
job_print_logs(
job: CoerceableToJobId, since_ms: int | None = None, file: IO | None = None
) -> None
Fetch and print logs for a job
Parameters:
- job (
CoerceableToJobId) – the identifier of a job or aRunResponseobject. - since_ms (
int | None) – Timestamp, in milliseconds since epoch, to get logs for. Defaults to None for all logs. - file (
IO | None) – Where to print logs to. Defaults to sys.stdout.
Returns:
None– None
job_tail_logs
job_tail_logs(
job: CoerceableToJobId,
refresh_seconds: float = 1,
sample_logs: bool = True,
timeout: float | None = None,
)
Continuously print logs for a job
Parameters:
- job (
CoerceableToJobId) – the identifier of a job or aRunResponseobject. - refresh_seconds (
float) – how frequently, in seconds, to check for new logs. Defaults to 1. - sample_logs (
bool) – if true, print out only a sample of logs. Defaults to True. - timeout (
float | None) – if not None, how long to continue tailing logs for. Defaults to None for indefinite.
job_wait_for_job
job_wait_for_job(
job: CoerceableToJobId,
poll_interval_seconds: float = 5,
timeout: float | None = None,
) -> RunResponse
Block the Python kernel until this job has finished
Parameters:
- poll_interval_seconds (
float) – How often (in seconds) to poll for status updates. Defaults to 5. - timeout (
float | None) – The length of time in seconds to wait for the job. Defaults to None.
Raises:
[TimeoutError](#TimeoutError)– if waiting for the job timed out.
Returns:
[RunResponse](#fused.models.internal.job.RunResponse)– The status of the given job.
job_wait_for_results
job_wait_for_results(
job: CoerceableToJobId,
poll_interval_seconds: float = 5,
timeout: float | None = None,
) -> list[UdfEvaluationResult]
list
list(path: str, *, details: bool = False) -> list[str] | list[ListDetails]
List the files at the path.
Parameters:
- path (
str) – Parent directory URL, likefd://bucket-name/ - details (
bool) – If True, return additional metadata about each record.
Returns:
[list](#fused.api._public_api.list)\[[str](#str)\] | [list](#fused.api._public_api.list)\[[ListDetails](#fused.models.api.ListDetails)\]– A list of paths as URLs, or as metadata objects.
Examples:
fused.api.list("fd://bucket-name/")
log
log(
id: str | None = None,
*,
udf_id: str | None = None,
udf_name: str | None = None,
shared_token: str | None = None,
exec_env: bool = False,
distinct: bool = False,
distinct_type: Literal["names", "ids"] | None = None,
start_timestamp: str | None = None,
end_timestamp: str | None = None,
limit: int = 100,
scan_forward: bool = True,
page_token: str | None = None,
max_records_to_scan: int = 1000
) -> dict[str, Any]
Get audit logs with flexible filtering options.
Routes to the appropriate audit log method based on the provided arguments.
Parameters:
- id (
str | None) – Get audit log by record ID. If provided, other filters are ignored. - udf_id (
str | None) – Filter logs by UDF ID. - udf_name (
str | None) – Filter logs by UDF name. - shared_token (
str | None) – Filter logs by shared token. - exec_env (
bool) – If True, filter by execution environment. Defaults to False. - distinct (
bool) – If True, return distinct values instead of full logs. Defaults to False. - distinct_type (
Literal['names', 'ids'] | None) – When distinct=True, specify "names" or "ids" to get distinct UDF names or IDs. - start_timestamp (
str | None) – Start timestamp (ISO format, inclusive). Defaults to None. - end_timestamp (
str | None) – End timestamp (ISO format, inclusive). Defaults to None. - limit (
int) – Maximum number of items to return (max 300). Used for regular log queries. Defaults to 100. - scan_forward (
bool) – If True, scan forward in time; if False, scan backward. Defaults to True. - page_token (
str | None) – Pagination token from previous response. Defaults to None. - max_records_to_scan (
int) – Maximum number of records to scan (max 5000). Used for distinct queries. Defaults to 1000.
Returns:
[dict](#dict)\[[str](#str), [Any](#typing.Any)\]– Dictionary containing items, limit, and next_page_token.
Examples:
# Get all logs for the authenticated user
logs = fused.api.log()
# Get logs filtered by execution environment
logs = fused.api.log(exec_env=True)
# Get logs by UDF ID
logs = fused.api.log(udf_id="udf-id")
# Get logs by UDF name
logs = fused.api.log(udf_name="my_udf")
# Get logs by shared token
logs = fused.api.log(shared_token="shared-token")
# Get a specific log by ID
log_entry = fused.api.log(id="audit-log-id")
# Get distinct UDF names
distinct_names = fused.api.log(distinct=True, distinct_type="names")
# Get distinct UDF IDs filtered by execution environment
distinct_ids = fused.api.log(distinct=True, distinct_type="ids", exec_env=True)
logout
logout()
Log out the current user.
This deletes the credentials saved to disk and resets the global Fused API.
modal_connect
modal_connect() -> modal.Client
notion_connect
notion_connect() -> FusedNotionConnection
Create a Notion connection using Fused-managed OAuth.
Returns:
- A (
[FusedNotionConnection](#fused.api._notion.FusedNotionConnection)) – class:FusedNotionConnectioninstance.
resolve
resolve(path: str) -> str
Resolve a path from fd:// to the full S3 URI.
Parameters:
- path (
str) – The path to resolve.
Returns:
[str](#str)– S3 resolved path
schedule_list
schedule_list()
List all cron jobs
schedule_udf
schedule_udf(
udf: BaseUdf | str,
minute: list[int] | int,
hour: list[int] | int,
day_of_month: list[int] | int | None = None,
month: list[int] | int | None = None,
day_of_week: list[int] | int | None = None,
udf_args: dict[str, Any] | None = None,
enabled: bool = True,
_create_udf: bool = True,
**kwargs: bool
) -> CronJob
Schedule a UDF to run on a cron schedule.
Parameters:
- udf (
BaseUdf | str) – The UDF to schedule. - minute (
list[int] | int) – The minute to run the UDF on. - hour (
list[int] | int) – The hour to run the UDF on. - day_of_month (
list[int] | int | None) – The day of the month to run the UDF on. (Default every day) - month (
list[int] | int | None) – The month to run the UDF on. (Default every month) - day_of_week (
list[int] | int | None) – The day of the week to run the UDF on. (Default every day) - udf_args (
dict[str, Any] | None) – The arguments to pass to the UDF. (Default None) - enabled (
bool) – Whether the cron job is enabled. (Default True) - _create_udf (
bool) – Save the UDF to Fused before creating the CronJob. (Default True)
session_token
session_token(session_max_age: str | int = '1h') -> SessionToken
Create a session token for the current workbench canvas.
Automatically resolves the canvas share token from the currently running UDF context. Must be called from within the Fused workbench.
Parameters:
- session_max_age (
str | int) – Lifetime of the session token. Accepts an integer (seconds) or a duration string such as"30m","1h","1d". Defaults to"1h".
Returns:
- A (
[SessionToken](#fused.models.api.SessionToken)) – class:SessionTokenwithsession_tokenandexpires_atfields.
sign_url
sign_url(path: str) -> str
Create a signed URL to access the path.
This function may not check that the file represented by the path exists.
Parameters:
- path (
str) – URL to a file, likefd://bucket-name/file.parquet
Returns:
[str](#str)– HTTPS URL to access the file using signed access.
Examples:
fused.api.sign_url("fd://bucket-name/table_directory/file.parquet")
sign_url_prefix
sign_url_prefix(path: str) -> dict[str, str]
Create signed URLs to access all blobs under the path.
Parameters:
- path (
str) – URL to a prefix, likefd://bucket-name/some_directory/
Returns:
[dict](#dict)\[[str](#str), [str](#str)\]– Dictionary mapping from blob store key to signed HTTPS URL.
Examples:
fused.api.sign_url_prefix("fd://bucket-name/table_directory/")
snowflake_connect
snowflake_connect(
*,
role: str | None = None,
warehouse: str | None = None,
database: str | None = None,
schema: str | None = None
) -> FusedSnowflakeConnection
Create a Snowflake connection using Fused-managed OAuth.
Parameters:
- role (
str | None) – Snowflake role to USE after connecting. - warehouse (
str | None) – Snowflake warehouse to USE after connecting. - database (
str | None) – Default database context. - schema (
str | None) – Default schema context.
Returns:
- A (
[FusedSnowflakeConnection](#fused.api._snowflake.FusedSnowflakeConnection)) – class:FusedSnowflakeConnectioninstance.
snowflake_query
snowflake_query(
sql: str,
*,
role: str | None = None,
warehouse: str | None = None,
database: str | None = None,
schema: str | None = None
) -> pd.DataFrame
Execute a SQL query against Snowflake and return a DataFrame.
This is a convenience wrapper around
:meth:FusedSnowflakeConnection.query.
Parameters:
- sql (
str) – The SQL statement to execute. - role (
str | None) – Snowflake role to USE after connecting. - warehouse (
str | None) – Snowflake warehouse to USE after connecting. - database (
str | None) – Default database context. - schema (
str | None) – Default schema context.
Returns:
- A (
[DataFrame](#pandas.DataFrame)) – class:~pandas.DataFramewith the query results.
team_info
team_info() -> dict
Fetch the team execution environment details.
Returns:
[dict](#dict)– A dictionary with information about the execution environment.
upload
upload(
local_path: str | Path | bytes | BinaryIO | pd.DataFrame | gpd.GeoDataFrame,
remote_path: str,
timeout: float | None = None,
) -> None
Upload local file to S3.
Parameters:
- local_path (
str | Path | bytes | BinaryIO | pd.DataFrame | gpd.GeoDataFrame) – Either a path to a local file (str,Path), a (Geo)DataFrame (which will get uploaded as Parquet file), or the contents to upload. Any string will be treated as a Path, if you wish to upload the contents of the string, first encode it:s.encode("utf-8") - remote_path (
str) – URL to upload to, likefd://new-file.txt - timeout (
float | None) – Optional timeout in seconds for the upload (will default toOPTIONS.request_timeoutif not specified).
Examples:
To upload a local json file to your Fused-managed S3 bucket:
fused.api.upload("my_file.json", "fd://my_bucket/my_file.json")
whoami
whoami()
Returns information on the currently logged in user
FusedAPI Class Methods
The following methods require creating a FusedAPI instance first:
from fused.api import FusedAPI
api = FusedAPI()
api.method_name()
fused.api.FusedAPI
FusedAPI(
*,
base_url: str | None = None,
shared_udf_base_url: str | None = None,
set_global_api: bool = True,
credentials_needed: bool = True
)
API for running jobs in the Fused service.
Create a FusedAPI instance.
Other Parameters:
- base_url (
[str](#str) | None) – The Fused instance to send requests to. Defaults tohttps://www.fused.io/server/v1. - shared_udf_base_url (
[str](#str) | None) – The shared UDF instance to send requests to. Defaults tohttps://www.udf.ai. - set_global_api (
[bool](#bool)) – Set this as the global API object. Defaults to True. - credentials_needed (
[bool](#bool)) – If True, automatically attempt to log in. Defaults to True.
create_udf_access_token
create_udf_access_token(
udf_email_or_name_or_id: str | None = None,
/,
udf_name: str | None = None,
*,
udf_email: str | None = None,
udf_id: str | None = None,
client_id: str | Ellipsis | None = ...,
public_read: bool | None = None,
access_scope: str | None = None,
cache: bool = True,
metadata_json: dict[str, Any] | None = None,
enabled: bool = True,
) -> UdfAccessToken
Create a token for running a UDF. The token allows anyone who has it to run the UDF, with the parameters they choose. The UDF will run under your environment.
The token does not allow running any other UDF on your account.
Parameters:
- udf_email_or_name_or_id (
str | None) – A UDF ID, email address (for use with udf_name), or UDF name. - udf_name (
str | None) – The name of the UDF to create the token for.
Other Parameters:
- udf_email (
[str](#str) | None) – The email of the user owning the UDF, or, if udf_name is None, the name of the UDF. - udf_id (
[str](#str) | None) – The backend ID of the UDF to create the token for. - client_id (
[str](#str) | [Ellipsis](#Ellipsis) | None) – If specified, overrides which realtime environment to run the UDF under. - cache (
[bool](#bool)) – If True, UDF tiles will be cached. - metadata_json (
[dict](#dict)\[[str](#str), [Any](#typing.Any)\] | None) – Additional metadata to serve as part of the tiles metadata.json. - enabled (
[bool](#bool)) – If True, the token can be used.
Usage: from fused.api import FusedAPI; api = FusedAPI(); api.create_udf_access_token()
upload
upload(
path: str,
data: bytes | BinaryIO,
client_id: str | None = None,
timeout: float | None = None,
) -> None
Upload a binary blob to a cloud location
Usage: from fused.api import FusedAPI; api = FusedAPI(); api.upload()
start_job
start_job(
config: JobConfig | JobStepConfig,
*,
instance_type: WHITELISTED_INSTANCE_TYPES | None = None,
region: str | None = None,
disk_size_gb: int | None = None,
additional_env: Sequence[str] | None = ("FUSED_CREDENTIAL_PROVIDER=ec2",),
image_name: str | None = None,
send_status_email: bool | None = None,
cache_max_age: int | None = None
) -> RunResponse
Execute an operation
Parameters:
- config (
JobConfig | JobStepConfig) – the configuration object to run in the job.
Other Parameters:
- instance_type (
[WHITELISTED_INSTANCE_TYPES](#fused.models.request.WHITELISTED_INSTANCE_TYPES) | None) – The AWS EC2 instance type to use for the job. Acceptable strings are "m5.large", "m5.xlarge", "m5.2xlarge", "m5.4xlarge", "r5.large", "r5.xlarge", "r5.2xlarge", "r5.4xlarge". Defaults to None. - region (
[str](#str) | None) – The AWS region in which to run. Defaults to None. - disk_size_gb (
[int](#int) | None) – The disk size to specify for the job. Defaults to None. - additional_env (
[Sequence](#typing.Sequence)\[[str](#str)\] | None) – Any additional environment variables to be passed into the job, each in the form KEY=value. Defaults to None. - image_name (
[str](#str) | None) – Custom image name to run. Defaults to None for default image. - send_status_email (
[bool](#bool) | None) – Whether to send a status email to the user when the job is complete.
Usage: from fused.api import FusedAPI; api = FusedAPI(); api.start_job()
get_jobs
get_jobs(
n: int = 5,
*,
skip: int = 0,
per_request: int = 25,
max_requests: int | None = 1
) -> Jobs
Get the job history.
Parameters:
- n (
int) – The number of jobs to fetch. Defaults to 5.
Other Parameters:
- skip (
[int](#int)) – Where in the job history to begin. Defaults to 0, which retrieves the most recent job. - per_request (
[int](#int)) – Number of jobs per request to fetch. Defaults to 25. - max_requests (
[int](#int) | None) – Maximum number of requests to make. May be None to fetch all jobs. Defaults to 1.
Returns:
[Jobs](#fused.models.internal.Jobs)– The job history.
Usage: from fused.api import FusedAPI; api = FusedAPI(); api.get_jobs()
get_status
get_status(job: CoerceableToJobId) -> RunResponse
Fetch the status of a running job
Parameters:
- job (
CoerceableToJobId) – the identifier of a job or aRunResponseobject.
Returns:
[RunResponse](#fused.models.internal.RunResponse)– The status of the given job.
Usage: from fused.api import FusedAPI; api = FusedAPI(); api.get_status()
get_logs
get_logs(job: CoerceableToJobId, since_ms: int | None = None) -> list[Any]
Fetch logs for a job
Parameters:
- job (
CoerceableToJobId) – the identifier of a job or aRunResponseobject. - since_ms (
int | None) – Timestamp, in milliseconds since epoch, to get logs for. Defaults to None for all logs.
Returns:
[list](#fused.api.api.FusedAPI.list)\[[Any](#typing.Any)\]– Log messages for the given job.
Usage: from fused.api import FusedAPI; api = FusedAPI(); api.get_logs()
tail_logs
tail_logs(
job: CoerceableToJobId,
refresh_seconds: float = 1,
sample_logs: bool = False,
timeout: float | None = None,
)
Continuously print logs for a job
Parameters:
- job (
CoerceableToJobId) – the identifier of a job or aRunResponseobject. - refresh_seconds (
float) – how frequently, in seconds, to check for new logs. Defaults to 1. - sample_logs (
bool) – if true, print out only a sample of logs. Defaults to False. - timeout (
float | None) – if not None, how long to continue tailing logs for. Defaults to None for indefinite.
Usage: from fused.api import FusedAPI; api = FusedAPI(); api.tail_logs()
wait_for_job
wait_for_job(
job: CoerceableToJobId,
poll_interval_seconds: float = 5,
timeout: float | None = None,
) -> RunResponse
Block the Python kernel until the given job has finished
Parameters:
- job (
CoerceableToJobId) – the identifier of a job or aRunResponseobject. - poll_interval_seconds (
float) – How often (in seconds) to poll for status updates. Defaults to 5. - timeout (
float | None) – The length of time in seconds to wait for the job. Defaults to None.
Raises:
[TimeoutError](#TimeoutError)– if waiting for the job timed out.
Returns:
[RunResponse](#fused.models.internal.RunResponse)– The status of the given job.
Usage: from fused.api import FusedAPI; api = FusedAPI(); api.wait_for_job()
cancel_job
cancel_job(job: CoerceableToJobId) -> RunResponse
Cancel an existing job
Parameters:
- job (
CoerceableToJobId) – the identifier of a job or aRunResponseobject.
Returns:
[RunResponse](#fused.models.internal.RunResponse)– A new job object.
Usage: from fused.api import FusedAPI; api = FusedAPI(); api.cancel_job()
auth_token
auth_token() -> str
Returns the current user's Fused environment (team) auth token
Usage: from fused.api import FusedAPI; api = FusedAPI(); api.auth_token()
Airtable
FusedAirtableConnection
fused.api.FusedAirtableConnection
FusedAirtableConnection(base_id: str | None = None)
Airtable integration using Fused-managed OAuth tokens.
The connection lazily fetches a short-lived OAuth access token from the Fused server and uses the Airtable REST API directly.
Parameters:
- base_id (
str | None) – Default Airtable base ID (e.g."appXXXXXXXXXXXXXX"). When provided, methods that accept abase_idparameter will fall back to this value.
create_records
create_records(
table: str, records: list[dict[str, Any]], *, base_id: str | None = None
) -> list[dict[str, Any]]
Create one or more records.
Parameters:
- table (
str) – Table name or ID. - records (
list\[dict[str, Any]\]) – List of{"fields": {...}}dicts. - base_id (
str | None) – Airtable base ID. Falls back to the default.
delete_records
delete_records(
table: str, record_ids: list[str], *, base_id: str | None = None
) -> list[dict[str, Any]]
Delete one or more records by ID.
Parameters:
- table (
str) – Table name or ID. - record_ids (
list[str]) – List of record IDs to delete. - base_id (
str | None) – Airtable base ID. Falls back to the default.
get_record
get_record(
table: str, record_id: str, *, base_id: str | None = None
) -> dict[str, Any]
Fetch a single record by ID.
Parameters:
- table (
str) – Table name or ID. - record_id (
str) – Airtable record ID (e.g."recXXXXXXXXXXXXXX"). - base_id (
str | None) – Airtable base ID. Falls back to the default.
list_bases
list_bases() -> list[dict[str, Any]]
Return the list of bases the token has access to.
list_records
list_records(
table: str, *, base_id: str | None = None, **params: Any
) -> list[dict[str, Any]]
List records from a table (auto-paginates).
Parameters:
- table (
str) – Table name or ID. - base_id (
str | None) – Airtable base ID. Falls back to the default. - **params (
Any) – Extra query parameters forwarded to the Airtable List Records endpoint (e.g.maxRecords,view,filterByFormula).
list_tables
list_tables(base_id: str | None = None) -> list[dict[str, Any]]
Return the tables in a base.
Parameters:
- base_id (
str | None) – Airtable base ID. Falls back to the default.
update_records
update_records(
table: str, records: list[dict[str, Any]], *, base_id: str | None = None
) -> list[dict[str, Any]]
Update one or more records (PATCH -- partial update).
Parameters:
- table (
str) – Table name or ID. - records (
list\[dict[str, Any]\]) – List of{"id": "rec...", "fields": {...}}dicts. - base_id (
str | None) – Airtable base ID. Falls back to the default.
Notion
FusedNotionConnection
fused.api.FusedNotionConnection
Notion integration using Fused-managed OAuth tokens.
The connection lazily fetches a short-lived OAuth access token from the Fused server and uses the Notion REST API directly.
client
client() -> NotionClient
Return a configured notion_client.Client using the Fused-managed OAuth token.
Requires the notion-client package::
pip install notion-client
create_comment
create_comment(
rich_text: list[dict[str, Any]],
*,
parent_id: str | None = None,
discussion_id: str | None = None
) -> dict[str, Any]
Create a comment on a page or as a reply in a discussion.
Provide exactly one of parent_id (top-level comment on a page)
or discussion_id (reply to an existing discussion thread).
Parameters:
- rich_text (
list\[dict[str, Any]\]) – List of rich text objects for the comment body. - parent_id (
str | None) – Page ID for a new top-level comment. - discussion_id (
str | None) – Discussion ID to reply to.
create_page
create_page(
parent: dict[str, Any],
properties: dict[str, Any],
*,
children: list[dict[str, Any]] | None = None
) -> dict[str, Any]
Create a new page.
Parameters:
- parent (
dict[str, Any]) – Parent object, e.g.{"page_id": "..."}or{"database_id": "..."}. - properties (
dict[str, Any]) – Page properties matching the parent schema. - children (
list\[dict[str, Any]\] | None) – Optional list of block objects for the page body.
delete_page
delete_page(page_id: str) -> dict[str, Any]
Move a page to the trash.
Notion does not support permanent deletion via the API.
Parameters:
- page_id (
str) – Notion page ID.
get_page
get_page(page_id: str) -> dict[str, Any]
Retrieve a page by ID.
Parameters:
- page_id (
str) – Notion page ID.
get_user
get_user(user_id: str) -> dict[str, Any]
Retrieve a user by ID.
Parameters:
- user_id (
str) – Notion user ID.
list_comments
list_comments(block_id: str, *, page_size: int = 100) -> list[dict[str, Any]]
List comments on a block or page (auto-paginates).
Parameters:
- block_id (
str) – The block or page ID to list comments for. - page_size (
int) – Number of results per request (max 100).
list_users
list_users(*, _page_size: int = 100) -> list[dict[str, Any]]
List all users in the workspace (auto-paginates).
Parameters:
- page_size – Number of results per request (max 100).
search
search(
query: str | None = None,
*,
filter: dict[str, Any] | None = None,
sort: dict[str, Any] | None = None,
_page_size: int = 100
) -> list[dict[str, Any]]
Search pages and databases by title (auto-paginates).
Parameters:
- query (
str | None) – Text to search for in page/database titles. - filter (
dict[str, Any] | None) – Optional filter object, e.g.{"value": "page", "property": "object"}. - sort (
dict[str, Any] | None) – Optional sort object, e.g.{"direction": "descending", "timestamp": "last_edited_time"}. - _page_size (
int) – Number of results per request (max 100).
update_page
update_page(
page_id: str,
*,
properties: dict[str, Any] | None = None,
in_trash: bool | None = None
) -> dict[str, Any]
Update a page's properties or trash/restore it.
Parameters:
- page_id (
str) – Notion page ID. - properties (
dict[str, Any] | None) – Property values to update. - in_trash (
bool | None) – SetTrueto move to trash,Falseto restore.
Snowflake
FusedSnowflakeConnection
fused.api.FusedSnowflakeConnection
FusedSnowflakeConnection(
role: str | None = None,
warehouse: str | None = None,
database: str | None = None,
schema: str | None = None,
)
Snowflake integration using Fused-managed OAuth tokens.
The connection lazily fetches a short-lived OAuth access token from the Fused
server and uses snowflake-connector-python with authenticator='oauth'
to talk directly to Snowflake.
Parameters:
- role (
str | None) – Snowflake role to USE after connecting. - warehouse (
str | None) – Snowflake warehouse to USE after connecting. - database (
str | None) – Default database context. - schema (
str | None) – Default schema context.
connect
connect(**kwargs: Any) -> snowflake.connector.SnowflakeConnection
Create a Snowflake connection using OAuth token.
execute
execute(sql: str, *args: str, **kwargs: str)
Execute SQL without returning results (DDL, DML).
list_databases
list_databases() -> list[str]
Return a list of database names (SHOW DATABASES).
list_schemas
list_schemas(database: str | None = None) -> list[str]
Return schema names. Optionally scoped to database.
Note: database is not escaped.
list_stage_files
list_stage_files(stage: str, pattern: str | None = None) -> list[str]
List files in a stage (LIST @stage).
Parameters:
- stage (
str) – Stage reference, e.g."@my_stage"or"@db.schema.stage". - pattern (
str | None) – Optional SQL LIKE pattern to filter files.
Note: stage and pattern are not escaped.
list_stages
list_stages(
database: str | None = None, schema: str | None = None
) -> list[str]
Return stage names. Optionally scoped to database/schema.
Note: database and schema are not escaped.
list_tables
list_tables(
database: str | None = None, schema: str | None = None
) -> list[str]
Return table names. Optionally scoped to database/schema.
Note: database and schema are not escaped.
query
query(sql: str, *args: str, **kwargs: str) -> pd.DataFrame
Execute SQL and return results as a DataFrame.
read_stage
read_stage(stage_path: str) -> pd.DataFrame
Read a file from a stage into a DataFrame.
Uses SELECT $1, $2, ... FROM @stage/path which works for
CSV / semi-structured data that Snowflake can auto-detect.
Parameters:
- stage_path (
str) – Full stage path, e.g."@my_stage/data.csv".
Note: stage_path is not escaped.
write
write(df: pd.DataFrame, table: str, mode: str = 'append', **kwargs: Any)
Write a DataFrame to a Snowflake table using write_pandas.
Parameters:
- df (
pd.DataFrame) – DataFrame to write. - table (
str) – Fully-qualified or simple table name. - mode (
str) –"append"(default) or"overwrite". - **kwargs (
Any) – Extra keyword arguments forwarded tosnowflake.connector.pandas_tools.write_pandas.