Data structures

edeposit.amqp.calibre.structures.INPUT_FORMATS = ['cbz', 'cbr', 'cbc', 'chm', 'djvu', 'docx', 'epub', 'fb2', 'html', 'htmlz', 'lit', 'lrf', 'mobi', 'odt', 'pdf', 'prc', 'pdb', 'pml', 'rb', 'rtf', 'snb', 'tcr', 'txt', 'txtz']

List of available input formats.

edeposit.amqp.calibre.structures.OUTPUT_FORMATS = ['azw3', 'epub', 'fb2', 'oeb', 'lit', 'lrf', 'mobi', 'htmlz', 'pdb', 'pml', 'rb', 'pdf', 'rtf', 'snb', 'tcr', 'txt', 'txtz']

List of available output formats.

class edeposit.amqp.calibre.structures.ConversionRequest(input_format, output_format, b64_data)[source]

This structure specifies details of AMQP message, which is passed to reactToAMQPMessage() as request for conversion.

Parameters:
  • input_format (str) – See INPUT_FORMATS for list of valid input formats
  • output_format (str) – See OUTPUT_FORMATS for list of valid output formats.
  • b64_data (base64 str) – base64 encoded file.
Raises:

ValueError – if invalid input/output format is provided.

class edeposit.amqp.calibre.structures.ConversionResponse[source]

Structure is returned as response from reactToAMQPMessage(), when the file is converted.

Parameters:
  • type (str) – See OUTPUT_FORMATS for details.
  • b64_data (base64 str) – base64 encoded converted data.
  • protocol (str) – Protocol of the conversion.