Calibre package

AMQP communication wrapper for calibre’s ebook-convert program.

edeposit.amqp.calibre.reactToAMQPMessage(message, send_back)[source]

React to given (AMQP) message. message is usually expected to be collections.namedtuple() structure filled with all necessary data.

Parameters:
  • message (*Request class) – only ConversionRequest class is supported right now
  • send_back (fn reference) – Reference to function for responding. This is useful for progress monitoring for example. Function takes one parameter, which may be response structure/namedtuple, or string or whatever would be normally returned.
Returns:

response filled with data about conversion and converted file.

Return type:

ConversionResponse

Raises:

ValueError – if bad type of message structure is given.

Lowlevel access

It is possible to access module directly, by calling python functions to convert data. If you are interested in this way of accessing functuions, please look at: