transloadit package

Submodules

transloadit.client module

transloadit.assembly module

transloadit.template module

class transloadit.template.Template(transloadit, name, options=None)[source]

Bases: OptionBuilder

Object representation of a new Template to be created.

Attributes:
  • transloadit (<translaodit.client.Transloadit>):

    An instance of the Transloadit class.

  • name (str):

    The name of the template to be created.

Constructor Args:
create()[source]

Save/Submit the template to the Transloadit server.

transloadit.optionbuilder module

class transloadit.optionbuilder.OptionBuilder(options=None)[source]

Bases: object

Object representation of a new Assembly to be created.

Attributes:
  • transloadit (<transloadit.client.Transloadit>):

    An instance of the Transloadit class.

  • files (dict):

    storage of files to be uploaded. Each file is stored with a key corresponding to its field name when it is being uploaded.

Constructor Args:
add_step(name, robot, options)[source]

Add a step to the Assembly/Template

Args:
  • name (str): The name of the step.

  • robot (str): The name of the robot for the step

  • options (dict): The options to apply to the step

get_options()[source]

Return the Assembly/Template options in Transloadit, ready format.

remove_step(name)[source]

Remove the step specified by the given name.abs

Args:
  • name (str): The name of the step to remove.

transloadit.request module

class transloadit.request.Request(transloadit)[source]

Bases: object

Transloadit tailored HTTP Request object.

Attributes:
  • transloadit (<translaodit.client.Transloadit>):

    An instance of the Transloadit class.

Constructor Args:
  • transloadit (<transloadit.client.Transloadit>)

HEADERS = {'Transloadit-Client': 'python-sdk:1.0.4'}
delete(path, data=None)[source]

Makes a HTTP DELETE request.

Args:
  • path (str): URL path to which the request should be made.

  • data (Optional[dict]): The body of the request.

Return an instance of <transloadit.response.Response>

get(path, params=None)[source]

Makes a HTTP GET request.

Args:
  • path (str): URL path to which the request should be made.

  • params (Optional[dict]): Optional params to send along with the request.

Return an instance of <transloadit.response.Response>

post(path, data=None, extra_data=None, files=None)[source]

Makes a HTTP POST request.

Args:
  • path (str): URL path to which the request should be made.

  • data (Optional[dict]): The body of the request. This would be stored under the ‘params’ field.

  • extra_data (Optional[dict]): This is also added to the body of the request but not under the

    ‘params’ field.

  • files (Optional[dict]): Files to upload with the request. This should be a key, value pair of

    field name and file stream respectively.

Return an instance of <transloadit.response.Response>

put(path, data=None)[source]

Makes a HTTP PUT request.

Args:
  • path (str): URL path to which the request should be made.

  • data (Optional[dict]): The body of the request.

Return an instance of <transloadit.response.Response>

transloadit.response module

class transloadit.response.Response(response)[source]

Bases: object

Transloadit http Response Object

Attributes:
  • data (dict):

    Dictionary representation of the returned JSON data.

  • status_code (int):

    HTTP response status code

  • headers (dict):

    Dictionary representation of the headers returned from the server.

Constructor Args:
  • response (<requests.Response>): The bare response object from the requests library.

property headers

Return the response headers.

property status_code

Return the http status code of the request.

transloadit.response.as_response(func)[source]

Decorator function that converts the output of a function into an instance of the <transloadit.response.Response> class.