{ "info": { "author": "Journalism Robotics Stockholm", "author_email": "contact@newsworthy.se", "bugtrack_url": null, "classifiers": [], "description": "\nInstalling\n----------\n\n.. code-block:: bash\n\n pip install newsworthy_slides\n\n\nUsing\n-----\n\nThis library has one main function: `slides_from_xml()` which lets you generate and slides from a custom HTML structure (described below).\n\nBasic usage:\n\n.. code-block:: python\n\n from newsworthy_slides import slides_from_xml\n\n slides_xml = \"\"\"\n \n \n Hello world!\n \n \n \"\"\"\n\n # Generate to new, empty presentation\n pres = slides_from_xml(slides_xml)\n\n # Generate to existing presentation\n pres = slides_from_xml(slides_xml, \"path/to/my_base_slides.pptx\")\n\n # pres is an instance of pptx.Presentation and can be saved easily:\n pres.save('my_presentation.pptx')\n\n\n\nThe XML structure\n-----------------\n\n\nSlides\n~~~~~~\n\nA slide must always have a `layout` attribute referring to the name of a slide layout.\n\n.. code-block:: XML\n\n \n \n\nA slide _may_ have `position` attribute which defines where in the presentation the slide is to be added.\n\nA slide consists of a number of placeholders.\n\n.. code-block:: XML\n\n \n \n Hello world!\n \n \n\nEach placeholder must have a `type` attribute, which can be either `text`, `image`, `table`. The `type` attribute defines how the content of the tag is to be interpreted.\n\nThe placeholders may also have a `name` attribute. This attribute should refer to a placeholder name in the slide layout.\n\n.. code-block:: XML\n\n \n Hello\n World!\n \n\nIf no placeholder name is defined the placeholders will be positioned in order.\n\n.. code-block:: XML\n\n \n First placeholder\n Second placeholder\n \n\n\nThe different placeholders types are defined below.\n\nText placeholders\n~~~~~~~~~~~~~~~~~\n\nText placeholders may contain plain text or basic html. `

` and `

  • ` tags are interpreted as paragraphs.\n\n.. code-block:: XML\n\n \n Hello world!\n \n\n \n

    Hello Earth!

    \n

    Hello Mars!

    \n
    \n\n \n
  • Hello Earth!
  • \n
  • Hello Mars!
  • \n \n\n``, ``/`` and `` tags may be used for inline formating and linking.\n\n.. code-block:: XML\n\n \n Hello world. Considering a Mars?\n \n\n\nImage placeholders\n~~~~~~~~~~~~~~~~~~\n\nAn image placeholder recognizes `` tags and picks up the path (or url) to the image from the `src` attribute.\n\n.. code-block:: XML\n\n \n \n \n\nNote that the placeholder explicitly has to be a picture placeholder. This has to be set manually in Powerpoint. At the moment of writing Google Slides does not support picture placeholders (neither does Libre Office). A base presentation from Google Slides will not, in other words, be able to handle this image placeholders.\n\nTable placeholders\n~~~~~~~~~~~~~~~~~~\n\nA table placeholder should contain an html table. All `` tags are parsed as rows. `` and `` tags are parsed as cells. The cells may contain same basic text formatting as paragraphs (`` for bold, `` for italic etc).\n\nCells with `class=\"value\"` are interpreted as numbers and right-aligned.\n\n`` and `` may be present, but does not bring any meaning. `` is _not_ parsed.\n\n.. code-block:: XML\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    CountryHappiness
    Finland9.5
    Sweden8.5
    \n
    \n\nDeveloping\n----------\n\nTo run tests:\n\n.. code-block:: bash\n\n python3 -m pytest test\n\nDeployment\n----------\n\nTo deploy a new version to PyPi:\n\n1. Update Changelog below.\n2. Update `version.py`\n3. Build: `python3 setup.py sdist bdist_wheel`\n4. Upload: `python3 -m twine upload dist/newsworthy_slides-X.Y.X*`\n\n...assuming you have Twine installed (`pip install twine`) and configured.\n\nChangelog\n---------\n\n- 1.0.1 Add custom exception if image is missing\n\n- 1.0.0 First version\n\n\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "https://gitlab.com/newsworthy/newsworthy_slides/archive/1.0.1.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.com/newsworthy/newsworthy_slides", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "newsworthy-slides", "package_url": "https://pypi.org/project/newsworthy-slides/", "platform": "", "project_url": "https://pypi.org/project/newsworthy-slides/", "project_urls": { "Download": "https://gitlab.com/newsworthy/newsworthy_slides/archive/1.0.1.tar.gz", "Homepage": "https://gitlab.com/newsworthy/newsworthy_slides" }, "release_url": "https://pypi.org/project/newsworthy-slides/1.0.1/", "requires_dist": [ "python-pptx (>=0.6.18)", "pytest (>=3.10.1)", "beautifulsoup4 (>=4.7.1)", "requests (>=2.22.0)" ], "requires_python": "~=3.5", "summary": "Generate PPTX slides and presentations from HTML markup.", "version": "1.0.1" }, "last_serial": 5840362, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "735025cfc188bbe0835eed6167c6dbe8", "sha256": "f7e1698bd3837f822c9acb966eead78c54e8c9de0bfa4201e16e198e01d1c0d9" }, "downloads": -1, "filename": "newsworthy_slides-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "735025cfc188bbe0835eed6167c6dbe8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.5", "size": 9586, "upload_time": "2019-09-09T13:15:46", "url": "https://files.pythonhosted.org/packages/b1/45/5b5412165791b4323bdf1268ee423a121403fad289794eefa8f422035a8b/newsworthy_slides-1.0.0-py3-none-any.whl" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "261a27d1cacf07d1c96cf1de12f28344", "sha256": "2388e618d669a9a3aa665e5b47eeceffa0665fffb6d443149edd1d66fe584194" }, "downloads": -1, "filename": "newsworthy_slides-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "261a27d1cacf07d1c96cf1de12f28344", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.5", "size": 9686, "upload_time": "2019-09-17T08:52:36", "url": "https://files.pythonhosted.org/packages/81/8b/e01323765c4d361d217b17ef2212e4766e6a93bb5a41f3786643ab7747f5/newsworthy_slides-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e5dc61f28b4021095eb70fab1008ccb1", "sha256": "725ce35f2fb6276f7d6ae88d4425098982557a3a5d6099c53d9ef5034e235e66" }, "downloads": -1, "filename": "newsworthy_slides-1.0.1.tar.gz", "has_sig": false, "md5_digest": "e5dc61f28b4021095eb70fab1008ccb1", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.5", "size": 11070, "upload_time": "2019-09-17T08:52:37", "url": "https://files.pythonhosted.org/packages/46/a1/6b9f0a04200def35ae46cc3b91a04e5536712103c37eb6cc8158fd73c50c/newsworthy_slides-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "261a27d1cacf07d1c96cf1de12f28344", "sha256": "2388e618d669a9a3aa665e5b47eeceffa0665fffb6d443149edd1d66fe584194" }, "downloads": -1, "filename": "newsworthy_slides-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "261a27d1cacf07d1c96cf1de12f28344", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.5", "size": 9686, "upload_time": "2019-09-17T08:52:36", "url": "https://files.pythonhosted.org/packages/81/8b/e01323765c4d361d217b17ef2212e4766e6a93bb5a41f3786643ab7747f5/newsworthy_slides-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e5dc61f28b4021095eb70fab1008ccb1", "sha256": "725ce35f2fb6276f7d6ae88d4425098982557a3a5d6099c53d9ef5034e235e66" }, "downloads": -1, "filename": "newsworthy_slides-1.0.1.tar.gz", "has_sig": false, "md5_digest": "e5dc61f28b4021095eb70fab1008ccb1", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.5", "size": 11070, "upload_time": "2019-09-17T08:52:37", "url": "https://files.pythonhosted.org/packages/46/a1/6b9f0a04200def35ae46cc3b91a04e5536712103c37eb6cc8158fd73c50c/newsworthy_slides-1.0.1.tar.gz" } ] }