ulif.openoffice.client – Python client for doc conversions

Client API to access all functionality via programmatic calls.

class ulif.openoffice.client.Client(cache_dir=None)

A client to trigger document conversions.

ulif.openoffice.client.convert_doc(src_doc, options, cache_dir)

Convert src_doc according to the other parameters.

src_doc is the path to the source document. options is a dict of options for processing, passed to the processors.

cache_dir may be None in which no caching is requested during processing.

Generates a converted representation of src_doc by calling ulif.openoffice.processor.MetaProcessor with options as parameters.

Afterwards the conversion result is stored in cache (if allowed/possible) for speedup of upcoming requests.

Returns a triple:

(<PATH>, <CACHE_KEY>, <METADATA>)

where <PATH> is the path to the resulting document, <CACHE_KEY> an identifier (string) to retrieve a generated doc from cache on future requests, and <METADATA> is a dict of values returned during request (and set by the document processors, notably setting the error keyword).

If errors happen or caching is disabled, <CACHE_KEY> is None.

Previous topic

ulif.openoffice.cachemanager – A Cache Manager

Next topic

ulif.openoffice.convert – A Document Converter

This Page