FileImportResource
API Access class for file imports
Source code in src/specklepy/api/resources/current/file_import_resource.py
start_file_import
generate_upload_url
Get a file upload url from the Speckle server.
This method asks the server to create a pre-signed S3 url, which can be used as a short term authenticated route, to put a file to the server.
Source code in src/specklepy/api/resources/current/file_import_resource.py
upload_file
Uploads a file to the given S3 url.
This method should be used together with the generate_upload_url method, which generates a pre-signed S3 url, that can be used to upload the file to.
Source code in src/specklepy/api/resources/current/file_import_resource.py
download_file
Download a file blob attached to the project, to the target path.
Source code in src/specklepy/api/resources/current/file_import_resource.py
finish_file_import_job
finish_file_import_job(
input: FinishFileImportInput,
) -> bool
This is mostly an internal api, that marks a file import job finished.
Only use this if you are writing a file importer, that is responsible for processing file import jobs.
Source code in src/specklepy/api/resources/current/file_import_resource.py
get_model_file_import_jobs
get_model_file_import_jobs(
*,
project_id: str,
model_id: str,
limit: int = 25,
cursor: str | None = None,
) -> ResourceCollection[FileImport]