Skip to main content

A simple CLI app that combines images to a single .pdf

Project description

i2pdf

i2pdf is a simple CLIP that combines .jpegs, .png, .jpg, .gif files into a single pdf. There is also the option of assigning metadata to this generated .pdf.

shields.io Version Number Lastupdated System System

License

i2pdf comes with the MIT license. Please use this license when reusing this code.

Dependencies

i2pdf was created with python 3.9 and should be used with this version of python

Standard Libraries

The following standard libraries are used.

os
platform

Pip

The following dependencies are necessary.

typer~=0.4.0
PyYAML~=6.0
Pillow~=9.0.1
PyPDF2~=1.26.0

Install

To install, enter the following command.

pip install i2pdf

If the installation was successful, then the following text should appear in the terminal

Mac example

Usage: main_app.py [OPTIONS] COMMAND [ARGS]...

Options:
  --install-completion [bash|zsh|fish|powershell|pwsh]
                                  Install completion for the specified shell.
  --show-completion [bash|zsh|fish|powershell|pwsh]
                                  Show completion for the specified shell, to
                                  copy it or customize the installation.

  --help                          Show this message and exit.

Commands:
  add-metadata  Add the data from the .yaml file to the .pdf as metadata.
  gen-dir       Generate directories where the files should reside.
  gen-pdf       Generate a .pdf from a collection of images.

Commands

add-metadata

Arguments:
  [PDF_NAME]     The name of the .pdf that should have metadata added.
                 [default: ]

  [CONFIG_NAME]  The name of the .yaml file which contains the config data.
                 [default: ]

  [SAVE_NAME]    The name of the new .pdf file with metadata.  [default:
                 results]

Example:

i2pdf add-metadata test.pdf test.yml

If you wish to have metadata added to the .pdf, you must store it in a .yaml or .yml file.

The format of this file should be as follows:

/author: test author
/keywords: test keywords

This file should be stored in the config folder.

gen-dir

Before you can combine the images to a .pdf, you must first generate the necessary folders. It is possible to do this by hand, but this command automatically generates the folders in the directy in which i2pdf was called.

The following empty folders are generated:

Folder Description
config this contains the .yaml files.
images the image files that are to be combined to a pdf
pdfs the generated .pdf files.
results the pdf files that had metadata added .

gen-pdf

Arguments:
  [SAVE_NAME]  Enter the save name of the .pdf file  [default: generated]

Example:

i2pdf generate-pdf testfile

Place the images in this file that are to be combined to a .pdf file. You have the option of specifying a name for the file being generated. if no file is added, then it is automatically called generated

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

i2pdf-1.0.9-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

i2pdf-1.0.9-py2.py3-none-any.whl (6.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file i2pdf-1.0.9-py3-none-any.whl.

File metadata

  • Download URL: i2pdf-1.0.9-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.2 tqdm/4.56.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.6

File hashes

Hashes for i2pdf-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 22823bb77d5939bb807ae5a43964a2ffa72c04ca7d473397a57e8388e9710c3a
MD5 945dbe1a8358a478731adf9065afc52b
BLAKE2b-256 9c8d9e18f25d743acc394dbc15a209ae4fadbfb8040ae3c9f9fd10b5ca5d8a86

See more details on using hashes here.

File details

Details for the file i2pdf-1.0.9-py2.py3-none-any.whl.

File metadata

  • Download URL: i2pdf-1.0.9-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.2 tqdm/4.64.1 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.6

File hashes

Hashes for i2pdf-1.0.9-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8ee02ecfb7c8f98f9cb636be0ed5a61e12248d22095c0996de1fac45ee6d9774
MD5 a9afc81f94ff4a63006591d6e442098a
BLAKE2b-256 a867ddd52eb76bdce8497d2ba68507493a251fd42e505df404ebf24e386ebd9a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page