Skip to main content

CircleCI pipeline status badge ReadTheDocs badge CodeCov badge pypi Python Version PyPI - license badge

Convert your XML into a Pdf table

Generate a multi-page PDF file from an XML file with the contents displayed in several tables based on filter criteria.

Table of content

💫Quickstart

As a starting point you could call

$ python -m pyxml2pdf.main input/template.xml

which will download a publicly available XML file into the folder input and process it as desired to produce the output files (one file containing all generated pages in landscape and additionally one file per page rotated into portrait) and place them in the subfolder output.

The intended way of using this software is calling main.py with the following command line parameters

  • positional arguments:

    • <local_file> The local file path to the XML file. If this file is not present, the optional input parameter '--url' needs to be provided with the URL from which the file shall be downloaded.
  • optional arguments:

👓Example

As an example we look at our input/template.xml and the processed result. Imagine you have an XML file with similar groups of tags and subtags.

<main_tag>
    <row_tag>
        <name_tag>Name 1</name_tag>
        <info_tag>Info 1</info_tag>
        <filter_tag>filter_1, filter_2</filter_tag>
    </row_tag>
    <row_tag>
        <name_tag>Name 2</name_tag>
        <info_tag>Info 2</info_tag>
        <filter_tag>filter_2, filter_3</filter_tag>
    </row_tag>
    <row_tag>
        <name_tag>Name 3</name_tag>
        <info_tag>Info 3</info_tag>
        <filter_tag>filter_2</filter_tag>
    </row_tag>
    <row_tag>
        <name_tag>Name 4</name_tag>
        <info_tag>Info 4</info_tag>
        <filter_tag>filter_1, filter_3</filter_tag>
    </row_tag>
    <row_tag>
        <name_tag>Name 5</name_tag>
        <info_tag>Info 5</info_tag>
        <filter_tag>filter_1</filter_tag>
    </row_tag>
</main_tag>

Now you want to visualize all row_tags with their subtags name_tag and info_tag fed into separate columns. And lastly you want to group those row_tags which satisfy certain filter criteria, that is their filter_tag contains certain combinations of comma-separated texts. Those groups of row_tags are extracted into several subtables each with a separating heading line and the corresponding column headings.

page one of the processed template.xml

📖Documentation

The API reference you can find on ReadTheDocs.

💻Installation

The installation of pyxml2pdf is as straightforward as the Python ecosystem suggests. Just create a virtual environment and install it via:

(venv) $ pip install pyxml2pdf

💨Coming soon

The next big step will be the deployment on Heroku.

👋Get in touch

In case you have any questions on this project do not hesitate to get in touch with us.

💎Acknowledgement

This project was prepared by Wojciech Kur in his repository XMLtoPDFConverter. We are grateful for his effort in designing the basic structure and built upon his main ideas. At some point our project diverged as much from his original work, as for us to justify to decouple our project from his. The fork is still kept (and maintained) as a special case in pyacb2pdf.

⚠Disclaimer

This software is developed in sole responsibility of Björn Ludwig. The software is made available "as is" free of cost. The author assumes no responsibility whatsoever for its use by other parties, and makes no guarantees, expressed or implied, about its quality, reliability, safety, suitability or any other characteristic. In no event will the author be liable for any direct, indirect or consequential damage arising in connection with the use of this software.

©License

pyxml2pdf is distributed under the GPLv3 license.

Metadata

Release files for pyxml2pdf 0.3.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyxml2pdf 0.3.5
File Size Uploaded Provenance Actions
pyxml2pdf-0.3.5.tar.gz 391.1 kB Without provenance Details for pyxml2pdf-0.3.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyxml2pdf 0.3.5
File Interpreter ABI Platform Actions
pyxml2pdf-0.3.5-py3-none-any.whl Python 3 none any Details for pyxml2pdf-0.3.5-py3-none-any.whl

Total release size: 784.6 kB

Release files / pyxml2pdf-0.3.5.tar.gz

Download URL pyxml2pdf-0.3.5.tar.gz
Size 391.1 kB
Tags Source
SHA-256 checksum
How to use checksums
39d6773d909951d069a59e1ca5a2cd379662e361e98df1f2c21897844d0c1037
BLAKE2b-256 checksum
How to use checksums
57349e37c378136f8cac539592d2cba98fb34cc84ce70dd604f89e315a6bdfd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.7

Release files / pyxml2pdf-0.3.5-py3-none-any.whl

Download URL pyxml2pdf-0.3.5-py3-none-any.whl
Size 393.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b94393e783c66ad52710e29d9dae07480f59ec90db0872d0e1417ad519ba992a
BLAKE2b-256 checksum
How to use checksums
c869027d3b3b37da80cff6166d5113eced7acc6806d1254da44f55675d65ab6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.7

Security for pyxml2pdf 0.3.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page