{ "info": { "author": "Cyril Nicodeme", "author_email": "contact@pdfshift.io", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT 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 :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Pre-processors", "Topic :: Text Editors :: Text Processing", "Topic :: Text Editors :: Word Processors", "Topic :: Text Processing :: Markup", "Topic :: Text Processing :: Markup :: HTML", "Topic :: Utilities" ], "description": "PDFShift Python Package\n=======================\n\nThis Python package provides a simplified way to interact with the [PDFShift](https://pdfshift.io) API.\n\n## Documentation\n\nSee the full documentation on [PDFShift's documentation](https://pdfshift.io/documentation).\n\n## Installation\n\nYou should not require this code directly. Instead, just run:\n\n pip install --upgrade pdfshift\n\nor\n\n easy_install --upgrade pdfshift\n\n\n### Requirements\n\n* Python 2.6+\n* [Requests](http://docs.python-requests.org/en/master/)\n\n## Usage\n\nThis library needs to be configured with your `api_key` received when creating an account.\nSetting it is easy as:\n\n```python\nimport pdfshift\npdfshift.api_key = '120d8e8a86d2....................'\n```\n\n### Basic example\n\n#### With an URL\n\n```python\nimport pdfshift\npdfshift.api_key = '120d8e8a86d2....................'\n\nbinary_file = pdfshift.convert('https://www.example.com')\n\nwith open('result.pdf', 'wb') as output:\n output.write(binary_file)\n```\n\n#### With inline HTML data:\n\n```python\nimport pdfshift\npdfshift.api_key = '120d8e8a86d2....................'\n\ndocument = open('invoice.html', 'r')\ndocument_content = document.read()\ndocument.close()\n\nbinary_file = pdfshift.convert(document_content)\nwith open('result.pdf', 'wb') as output:\n output.write(binary_file)\n```\n\n### Custom CSS\n\n#### Loading CSS from an URL:\n\n```python\nimport pdfshift\npdfshift.api_key = '120d8e8a86d2....................'\n\nbinary_file = pdfshift.convert(\n 'https://www.example.com',\n css=\"https://www.example.com/public/css/print.css\"\n)\n\nwith open('result.pdf', 'wb') as output:\n output.write(binary_file)\n```\n\n#### Loading CSS from a string:\n\n```python\nimport pdfshift\npdfshift.api_key = '120d8e8a86d2....................'\n\nbinary_file = pdfshift.convert(\n 'https://www.example.com',\n css=\"a {text-decoration: underline; color: blue}\"\n)\n\nwith open('result.pdf', 'wb') as output:\n output.write(binary_file)\n```\n\n### Custom HTTP Headers\n\n```python\nimport pdfshift\npdfshift.api_key = '120d8e8a86d2....................'\n\nbinary_file = pdfshift.convert(\n 'https://httpbin.org/headers',\n headers={\n 'X-Original-Header': 'Awesome value',\n 'user-agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0'\n }\n)\n\nwith open('result.pdf', 'wb') as output:\n output.write(binary_file)\n```\n\n### Accessing secured pages\n\n```python\nimport pdfshift\npdfshift.api_key = '120d8e8a86d2....................'\n\nbinary_file = pdfshift.convert('https://httpbin.org/basic-auth/user/passwd', auth=('user', 'passwd'))\n\nwith open('result.pdf', 'wb') as output:\n output.write(binary_file)\n```\n\n### Using cookies\n\n```python\nimport pdfshift\npdfshift.api_key = '120d8e8a86d2....................'\n\nbinary_file = pdfshift.convert(\n 'https://httpbin.org/cookies',\n cookies=[\n {'name': 'session', 'value': '4cb496a8-a3eb-4a7e-a704-f993cb6a4dac'}\n ]\n)\n\nwith open('result.pdf', 'wb') as output:\n output.write(binary_file)\n```\n\n### Adding Watermark (Oh hi Mark!)\n\n```python\nimport pdfshift\npdfshift.api_key = '120d8e8a86d2....................'\n\nbinary_file = pdfshift.convert(\n 'https://www.example.com',\n watermark={\n 'image': 'https://pdfshift.io/static/img/logo.png',\n 'offset_x': 50,\n 'offset_y': '100px',\n 'rotate': 45\n }\n)\n\nwith open('result.pdf', 'wb') as output:\n output.write(binary_file)\n```\n\n### Custom Header (or Footer)\n\n```python\nimport pdfshift\npdfshift.api_key = '120d8e8a86d2....................'\n\nbinary_file = pdfshift.convert(\n 'https://www.example.com',\n footer={\n 'source': '
Page {{page}} of {{total}}
',\n 'spacing': '50px'\n }\n)\n\nwith open('result.pdf', 'wb') as output:\n output.write(binary_file)\n```\n\n### Protecting the generated PDF\n\n```python\nimport pdfshift\npdfshift.api_key = '120d8e8a86d2....................'\n\nbinary_file = pdfshift.convert(\n 'https://www.example.com',\n protection={\n 'user_password': 'user',\n 'owner_password': 'owner',\n 'no_print': True\n }\n)\n\nwith open('result.pdf', 'wb') as output:\n output.write(binary_file)\n```\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://pdfshift.io", "keywords": "convert html pdf api pdfshift document", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pdfshift", "package_url": "https://pypi.org/project/pdfshift/", "platform": "", "project_url": "https://pypi.org/project/pdfshift/", "project_urls": { "Documentation": "https://pdfshift.io/documentation", "Homepage": "https://pdfshift.io", "Official Website": "https://pdfshift.io", "Source": "https://github.com/pdfshift/pdfshift-python" }, "release_url": "https://pypi.org/project/pdfshift/1.0.4/", "requires_dist": [ "requests" ], "requires_python": "", "summary": "Convert HTML documents to PDF using the PDFShift.io API.", "version": "1.0.4" }, "last_serial": 4026552, "releases": { "1.0.0b1": [ { "comment_text": "", "digests": { "md5": "eb87d2e45e8763266a9697fd4f01167c", "sha256": "699ddb0c25eff7f59b353aec4e01dae83f6b41eb1ce0320472ce567b0b8f64ea" }, "downloads": -1, "filename": "pdfshift-1.0.0b1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "eb87d2e45e8763266a9697fd4f01167c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3393, "upload_time": "2018-05-04T09:56:37", "url": "https://files.pythonhosted.org/packages/e6/30/33c379cd329cd5d74e4722691566f32e129501c116db9672ce570cdb8050/pdfshift-1.0.0b1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "505e51960c08eac3956479ff626e5337", "sha256": "f5efde9150893583f43b80639de5fc0b2bd6e2f91923ff3b3f4ef5b8d67b52fe" }, "downloads": -1, "filename": "pdfshift-1.0.0b1.tar.gz", "has_sig": false, "md5_digest": "505e51960c08eac3956479ff626e5337", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3342, "upload_time": "2018-05-04T09:56:38", "url": "https://files.pythonhosted.org/packages/f3/65/d6ca2bc8a73ca025dd8d724676e16b95339a756aeb1f75909f1ac75207ae/pdfshift-1.0.0b1.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "e8cca01c8a9519093779b7a6f5e7927c", "sha256": "3293b1b33bab33e438b2a73e0cf7b11936c177aa49a9e9b39ab6b887c435a4c6" }, "downloads": -1, "filename": "pdfshift-1.0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e8cca01c8a9519093779b7a6f5e7927c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5671, "upload_time": "2018-07-03T14:59:06", "url": "https://files.pythonhosted.org/packages/ee/d6/681807a26a6f7078fca7dbe41f15f4127399b2731cc45a623bb5bd6043ab/pdfshift-1.0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f61405daaf15bd4a5e0eda49c71e936a", "sha256": "d9d76a5da536a05bd862f876acfc28767cdeb6c9549591b4dc8bef0171f2f159" }, "downloads": -1, "filename": "pdfshift-1.0.4.tar.gz", "has_sig": false, "md5_digest": "f61405daaf15bd4a5e0eda49c71e936a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5047, "upload_time": "2018-07-03T14:59:08", "url": "https://files.pythonhosted.org/packages/d8/d8/9fe56ab69f82213e7ae5b8f1db5fb5a11059b103f4f4f8ae264e1c423975/pdfshift-1.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e8cca01c8a9519093779b7a6f5e7927c", "sha256": "3293b1b33bab33e438b2a73e0cf7b11936c177aa49a9e9b39ab6b887c435a4c6" }, "downloads": -1, "filename": "pdfshift-1.0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e8cca01c8a9519093779b7a6f5e7927c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5671, "upload_time": "2018-07-03T14:59:06", "url": "https://files.pythonhosted.org/packages/ee/d6/681807a26a6f7078fca7dbe41f15f4127399b2731cc45a623bb5bd6043ab/pdfshift-1.0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f61405daaf15bd4a5e0eda49c71e936a", "sha256": "d9d76a5da536a05bd862f876acfc28767cdeb6c9549591b4dc8bef0171f2f159" }, "downloads": -1, "filename": "pdfshift-1.0.4.tar.gz", "has_sig": false, "md5_digest": "f61405daaf15bd4a5e0eda49c71e936a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5047, "upload_time": "2018-07-03T14:59:08", "url": "https://files.pythonhosted.org/packages/d8/d8/9fe56ab69f82213e7ae5b8f1db5fb5a11059b103f4f4f8ae264e1c423975/pdfshift-1.0.4.tar.gz" } ] }