{ "info": { "author": "Jeremy Baker, Chirica Gheorghe", "author_email": "jhubert@gmail.com, chiricagheorghe@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Text Processing :: Markup :: HTML", "Topic :: Text Processing :: Markup :: XML" ], "description": "================\npydocx-s3-images\n================\n\nOverview\n========\nAn mixin for PyDocX that uploads the images to an S3 bucket instead of returning them as Data URIs when converting from .docx to html.\n\nRequirements\n============\n\n* Python 2.7\n* Works on Linux, Windows, Mac OSX, BSD\n\nInstall\n=======\n\nThe quick way::\n\n pip install pydocxs3upload\n\n\nUsage\n=====\n\nFirst of all, to use this mixin, you need to create you own amazon s3 bucket and give public permission so that uploaded images \ncan be accessed from generated html files. `Here `_ you can find a guide\nhow to do that. Once we have the bucket created, we need to generate a singed request that will be used to upload data to s3.\nSo, because of this signed request you have full control over the uploaded images. Using `this gist `_\nyou can simple generate such signature using boto library.\n\nHere is an example of mixin usage:\n\n.. code-block:: python\n\n from pydocx.export import PyDocXHTMLExporter\n from pydocxs3upload import S3ImageUploadMixin\n \n class PyDocXHTMLExporterS3ImageUpload(S3ImageUploadMixin, PyDocXHTMLExporter):\n pass\n \n docx_path = 'path/to/file/doc.docx'\n signed_request = ''\n exporter = PyDocXHTMLExporterS3ImageUpload(docx_path, s3_upload=signed_request)\n \n html = exporter.parsed\n\nNote that you can use the same signed request to convert any docs you want. So, in order to avoid uploading images with the same name and\noverriding previous one, each image is appended a timestamp which makes it unique. If, for some reasons, you don't want this feature by default\nyou can change it by passing parameter ``'unique_filename': False``.\n\n.. code-block:: python\n\n exporter = PyDocXHTMLExporterS3ImageUpload(docx_path, \n s3_upload=signed_request, unique_filename=False)\n\nIn this case all images are named as ``image1, image2, ..., imagen``.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jhubert/pydocx-s3-images", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "pydocxs3upload", "package_url": "https://pypi.org/project/pydocxs3upload/", "platform": "any", "project_url": "https://pypi.org/project/pydocxs3upload/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/jhubert/pydocx-s3-images" }, "release_url": "https://pypi.org/project/pydocxs3upload/0.0.1/", "requires_dist": null, "requires_python": null, "summary": "PyDocX mixin - S3 image upload", "version": "0.0.1" }, "last_serial": 1641888, "releases": { "0.0.1": [] }, "urls": [] }