benchling_sdk.services.v2.beta.v2_beta_data_frame_service module¶
- class V2BetaDataFrameService¶
Bases:
benchling_sdk.services.v2.base_service.BaseService
V2-Beta Data Frames.
Data Frames are Benchling objects that represent tabular data with typed columns and rows of data.
See https://benchling.com/api/v2-beta/reference#/Data%20Frames
- create(data_frame: benchling_api_client.v2.beta.models.data_frame_create.DataFrameCreate) benchling_api_client.v2.beta.models.data_frame.DataFrame ¶
Create a data frame.
See https://benchling.com/api/v2-beta/reference#/Data%20Frames/createDataFrame
- create_from_bytes(data_frame: benchling_api_client.v2.beta.models.data_frame_create.DataFrameCreate, input_bytes: Union[_io.BytesIO, bytes], timeout_seconds: float = _DEFAULT_HTTP_TIMEOUT_UPLOAD_DATA_FRAME) TaskHelper[benchling_api_client.v2.beta.models.data_frame.DataFrame] ¶
Create a data frame from bytes or BytesIO data.
- Parameters
data_frame â The DataFrameCreate specification for the data. This must be provided, as it cannot be inferred from file names.
input_bytes â Data to upload as bytes or BytesIO
timeout_seconds â Extends the normal HTTP timeout settings since DataFrame uploads can be large Use this to extend even further if streams are very large
- Returns
A TaskHelper that can be polled to know when the data frame has completed processing
- Return type
TaskHelper[DataFrame]
- create_from_file(file: Path, data_frame: Optional[benchling_api_client.v2.beta.models.data_frame_create.DataFrameCreate] = None, timeout_seconds: float = _DEFAULT_HTTP_TIMEOUT_UPLOAD_DATA_FRAME) TaskHelper[benchling_api_client.v2.beta.models.data_frame.DataFrame] ¶
Create a data frame from file data.
- Parameters
file â A valid Path to an existing file containing the data to upload
data_frame â The DataFrameCreate specification for the data. If not provided, it will be inferred from the file name
timeout_seconds â Extends the normal HTTP timeout settings since DataFrame uploads can be large Use this to extend even further if streams are very large
- Returns
A TaskHelper that can be polled to know when the data frame has completed processing
- Return type
TaskHelper[DataFrame]
- download_data_frame_bytes(data_frame: benchling_api_client.v2.beta.models.data_frame.DataFrame, timeout_seconds: float = _DEFAULT_HTTP_TIMEOUT_UPLOAD_DATA_FRAME) List[_io.BytesIO] ¶
Download data frame data to bytes.
- Parameters
data_frame â The data frame to download
timeout_seconds â Extends the normal HTTP timeout settings since DataFrame uploads can be large Use this to extend even further if streams are very large
- Returns
An ordered list of BytesIO streams corresponding to a manifest item in the data frame
- Return type
List[BytesIO]
- download_data_frame_bytes_by_id(data_frame_id: str, timeout_seconds: float = _DEFAULT_HTTP_TIMEOUT_UPLOAD_DATA_FRAME) List[_io.BytesIO] ¶
Download data frame data to files by data_frame_id.
Fetches the data frame first, then downloads the files.
- Parameters
data_frame_id â The id of the data frame to download
timeout_seconds â Extends the normal HTTP timeout settings since DataFrame uploads can be large Use this to extend even further if streams are very large
- Returns
An ordered list of BytesIO streams corresponding to a manifest item in the data frame
- Return type
List[BytesIO]
- download_data_frame_files(data_frame: benchling_api_client.v2.beta.models.data_frame.DataFrame, destination_path: Optional[Path] = None, timeout_seconds: float = _DEFAULT_HTTP_TIMEOUT_UPLOAD_DATA_FRAME) List[Path] ¶
Download data frame data to files.
- Parameters
data_frame â The data frame to download
destination_path â A target directory to place the files. File names will be created based on the manifest item file names. If not specified, a temp directory will be created. The caller is responsible for deleting this directory.
timeout_seconds â Extends the normal HTTP timeout settings since DataFrame uploads can be large Use this to extend even further if streams are very large
- Returns
An ordered list of downloaded file paths corresponding to a manifest item in the data frame
- Return type
List[Path]
- download_data_frame_files_by_id(data_frame_id: str, destination_path: Optional[Path] = None, timeout_seconds: float = _DEFAULT_HTTP_TIMEOUT_UPLOAD_DATA_FRAME) List[Path] ¶
Download data frame data to files by data_frame_id.
Fetches the data frame first, then downloads the files.
- Parameters
data_frame_id â The id of the data frame to download
destination_path â A target directory to place the files. File names will be created based on the manifest item file names. If not specified, a temp directory will be created. The caller is responsible for deleting this directory.
timeout_seconds â Extends the normal HTTP timeout settings since DataFrame uploads can be large Use this to extend even further if streams are very large
- Returns
An ordered list of downloaded file paths corresponding to a manifest item in the data frame
- Return type
List[Path]
- get_by_id(data_frame_id: str) benchling_api_client.v2.beta.models.data_frame.DataFrame ¶
Get a data frame and URLs to download its data.
See https://benchling.com/api/v2-beta/reference#/Data%20Frames/getDataFrame
- update(data_frame_id: str, data_frame: benchling_api_client.v2.beta.models.data_frame_update.DataFrameUpdate) TaskHelper[benchling_api_client.v2.beta.models.data_frame.DataFrame] ¶
Update a data frame.
See https://benchling.com/api/v2-beta/reference#/Data%20Frames/patchDataFrame
- upload_bytes(url: str, input_bytes: Union[_io.BytesIO, bytes], timeout_seconds: float = _DEFAULT_HTTP_TIMEOUT_UPLOAD_DATA_FRAME) None ¶
Upload bytes to an existing data frame.
- Parameters
url â The url provided by Benchling for uploading to the data frame
input_bytes â Data to upload as bytes or BytesIO
timeout_seconds â Extends the normal HTTP timeout settings since DataFrame uploads can be large Use this to extend even further if streams are very large
- upload_file(url: str, file: Path, timeout_seconds: float = _DEFAULT_HTTP_TIMEOUT_UPLOAD_DATA_FRAME) None ¶
Upload a file to an existing data frame.
- Parameters
url â The url provided by Benchling for uploading to the data frame
file â A valid Path to an existing file containing the data to upload
timeout_seconds â Extends the normal HTTP timeout settings since DataFrame uploads can be large Use this to extend even further if streams are very large