numerous.sdk.connect.file_manager module#

class numerous.sdk.connect.file_manager.FileManager(spm_client, project_id, scenario_id)#

Bases: object

upload_bytes(file_name, content, content_type=None)#

Uploads the given content with the given file name, as the content type if specified.

Parameters:
  • file_name (str) –

  • content (bytes) – The bytes file content.

  • content_type (Optional[str]) – The file content media type.

Return type:

None

upload_path(path)#

Uploads the file at the given path, inferring the content type.

Parameters:

path (str) –

Return type:

None

upload_stream(file_name, stream, content_type=None)#

Uploads the content read from the given content stream. Uses the given file name, and content type, if specified.

Parameters:
  • file_name (str) –

  • stream (IO[bytes]) – The file content bytes stream.

  • content_type (Optional[str]) – The file content media type.

Return type:

None

upload_text(file_name, content)#

Uploads the content with the given file name, as plain text.

Parameters:
  • file_name (str) –

  • content (str) – The text file content.

Return type:

None

class numerous.sdk.connect.file_manager.FileUploadContext(file_manager, file_name)#

Bases: object

write(data)#

Adds the content of a given string.

Parameters:

data (str) – The content.

write_from_file(file_name)#

Adds the content from a given file.

Parameters:

file_name (str) – the name of a file with the content.