jina.drivers.convert

class jina.drivers.convert.ConvertDriver(convert_fn, *args, **kwargs)[source]

Bases: jina.drivers.FlatRecursiveMixin, jina.drivers.BaseRecursiveDriver

Drivers that make sure that specific conversions are applied to the documents.

Note

The list of functions that can be applied can be found in :class:`Document

Parameters
  • convert_fn (str) – the method name from :class:`Document to be applied

  • args – additional positional arguments which are just used for the parent initialization

  • kwargs – the set of named arguments to be passed to convert_fn

runtime: Optional[ZEDRuntime]
class jina.drivers.convert.URI2Buffer(convert_fn='convert_uri_to_buffer', *args, **kwargs)[source]

Bases: jina.drivers.convert.ConvertDriver

Driver to convert URI to buffer

Parameters
  • convert_fn (str) – the method name from :class:`Document to be applied

  • args – additional positional arguments which are just used for the parent initialization

  • kwargs – the set of named arguments to be passed to convert_fn

runtime: Optional[ZEDRuntime]
class jina.drivers.convert.URI2DataURI(convert_fn='convert_uri_to_data_uri', *args, **kwargs)[source]

Bases: jina.drivers.convert.ConvertDriver

Driver to convert URI to data URI

Parameters
  • convert_fn (str) – the method name from :class:`Document to be applied

  • args – additional positional arguments which are just used for the parent initialization

  • kwargs – the set of named arguments to be passed to convert_fn

runtime: Optional[ZEDRuntime]
class jina.drivers.convert.Buffer2URI(convert_fn='convert_buffer_to_uri', *args, **kwargs)[source]

Bases: jina.drivers.convert.ConvertDriver

Driver to convert buffer to URI

Parameters
  • convert_fn (str) – the method name from :class:`Document to be applied

  • args – additional positional arguments which are just used for the parent initialization

  • kwargs – the set of named arguments to be passed to convert_fn

runtime: Optional[ZEDRuntime]
class jina.drivers.convert.BufferImage2Blob(convert_fn='convert_buffer_image_to_blob', *args, **kwargs)[source]

Bases: jina.drivers.convert.ConvertDriver

Driver to convert image buffer to blob

Parameters
  • convert_fn (str) – the method name from :class:`Document to be applied

  • args – additional positional arguments which are just used for the parent initialization

  • kwargs – the set of named arguments to be passed to convert_fn

runtime: Optional[ZEDRuntime]
class jina.drivers.convert.URI2Blob(convert_fn='convert_uri_to_blob', *args, **kwargs)[source]

Bases: jina.drivers.convert.ConvertDriver

Driver to convert URI to blob

Parameters
  • convert_fn (str) – the method name from :class:`Document to be applied

  • args – additional positional arguments which are just used for the parent initialization

  • kwargs – the set of named arguments to be passed to convert_fn

runtime: Optional[ZEDRuntime]
class jina.drivers.convert.DataURI2Blob(convert_fn='convert_data_uri_to_blob', *args, **kwargs)[source]

Bases: jina.drivers.convert.ConvertDriver

Driver to convert Data URI to image blob

Parameters
  • convert_fn (str) – the method name from :class:`Document to be applied

  • args – additional positional arguments which are just used for the parent initialization

  • kwargs – the set of named arguments to be passed to convert_fn

runtime: Optional[ZEDRuntime]
class jina.drivers.convert.Text2URI(convert_fn='convert_text_to_uri', *args, **kwargs)[source]

Bases: jina.drivers.convert.ConvertDriver

Driver to convert text to URI

Parameters
  • convert_fn (str) – the method name from :class:`Document to be applied

  • args – additional positional arguments which are just used for the parent initialization

  • kwargs – the set of named arguments to be passed to convert_fn

runtime: Optional[ZEDRuntime]
class jina.drivers.convert.URI2Text(convert_fn='convert_uri_to_text', *args, **kwargs)[source]

Bases: jina.drivers.convert.ConvertDriver

Driver to convert URI to text

Parameters
  • convert_fn (str) – the method name from :class:`Document to be applied

  • args – additional positional arguments which are just used for the parent initialization

  • kwargs – the set of named arguments to be passed to convert_fn

runtime: Optional[ZEDRuntime]
class jina.drivers.convert.Blob2PngURI(convert_fn='convert_blob_to_uri', *args, **kwargs)[source]

Bases: jina.drivers.convert.ConvertDriver

Driver to convert blob to URI

Parameters
  • convert_fn (str) – the method name from :class:`Document to be applied

  • args – additional positional arguments which are just used for the parent initialization

  • kwargs – the set of named arguments to be passed to convert_fn

runtime: Optional[ZEDRuntime]