flywheel.file_spec
FileSpec
A file or file-like object to be uploaded.
Wrapper class providing a file-like interface to upload methods, for uploading files via the SDK.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name | str | The name of the file being uploaded. | required |
contents | IOBase | If name is not the path to the file, this should be a file-like object from which the contents will be read. | None |
content_type | str | The mimetype of the file. | None |
size | int | The file size, in bytes. If the FileSpec is initialized with a file path, this will be looked up automatically from the file system. If not, it must be provided. | None |
to_file_tuple()
Returns a (filename, readable file-like object, mimetype) for this file.