civis.io.file_id_from_run_output

civis.io.file_id_from_run_output(name: str, job_id: int, run_id: int, regex: bool = False, client: APIClient | None = None) int[source]

Find the file ID of a File run output with the name “name”

The run output is required to have type “File”. If using an approximate match and multiple names match the provided string, return only the first file ID.

Parameters:
namestr

The “name” field of the run output you wish to retrieve. If .*? is passed in and regex is set to True, this will retrieve the file ID of the first run output

job_idint
run_idint
regexbool, optional

If False (the default), require an exact string match between name and the name of the run output. If True, search for a name which matches the regular expression name and retrieve the first found.

clientcivis.APIClient, optional

If not provided, an civis.APIClient object will be created from the CIVIS_API_KEY.

Returns:
file_idint

The ID of a Civis File with name matching name or, if name = “.*?” and regex = True, the ID of the first run output

Raises:
IOError

If the provided job ID and run ID combination can’t be found

FileNotFoundError

If the run exists, but name isn’t in its run outputs

See also

civis.APIClient.jobs.list_runs_outputs()