Add a PyDocX mixin that uploads images to S3 instead of returning them as a DataURI
$15-25 USD / hour
Terminado
Publicado hace casi 9 años
$15-25 USD / hour
The PyDocX python module converts docx files to HTML files. Currently, it handles images by returning them as Data URIs embedded in the HTML. This causes some issues when a file has large images or many images.
I need a mixin that intercepts the images, uploads them to S3 and replaces the Data URI with the URL to the file on S3 so that the resulting HTML loads the images remotely.
The tricky part is that the S3 signature and upload destination need to be provided on a per-document basis with the request. They can't be part of the ENV or hardcoded in the library.
The reason for this is that each document that gets processed will be coming from a different customer, and the customer's S3 information should be used so that the information is stored in their bucket.
Maybe something like:
exporter = CustomHTMLExporter('[login to view URL]', s3_options)
[login to view URL]
Where s3_options is:
policy: s3_upload_policy_document,
signature: s3_upload_signature,
key: '/uploads/${filename}',
Hi.
Ok, I just saw that you posted the project.
So, basically each doc needs to be uploaded to the customer S3? Maybe we can also have this configured so that we can use some custom S3, a global one so that we can have a full control where we deploy images?