Skip to main content

Create a PDF contact sheet from a set of images

Project description

imagecatalog

Docs PyPI Python Version License codecov Code style: black

Create a PDF contact sheet from a list of files.

Installation

Install from PyPI

pip install imagecatalog

or get latest dev version from GitHub.

pip install git+https://github.com/tdmorello/imagecatalog.git

Usage

Command line

imagecatalog -h
imagecatalog -i images/ -f '*.jpg' --title 'Image Catalog' example.pdf

PDF output

File paths and metadata can also be supplied from a csv file with headers "image", "label", "note"

$ head -n5 sample.csv
image,label,note
images/image_00.jpg,Image 0,image 0 note
images/image_01.jpg,Image 1,image 1 note
images/image_02.jpg,Image 2,image 2 note
images/image_03.jpg,Image 3,image 3 note
imagecatalog --csv sample.csv --title 'Image Catalog from CSV' example_csv.pdf

PDF output


Scripting

from imagecatalog import Catalog

# Catalog inherits from FPDF
# see https://github.com/PyFPDF/fpdf2 for more methods
catalog = Catalog()

# optionally add a title
catalog.set_title("Image Catalog")

# grab a set of existing images from a local directory
images = [f"images/image_{i:02}.jpg" for i in range(12)]

# optionally add labels (defaults to filenames)
labels = [f"Image {i}" for i in range(len(images))]

# optionally add notes
notes = [f"note for image {i}" for i in range(len(images))]

# generate the pdf
catalog.create(images, labels=labels, notes=notes, rows=4, cols=3)

# save
catalog.output("example.pdf")

Contributions

imagecatalog uses poetry for building and package management. Pull requests are welcome.

Project details


Download files

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

Source Distribution

imagecatalog-0.1.4.tar.gz (7.6 kB view hashes)

Uploaded Source

Built Distribution

imagecatalog-0.1.4-py3-none-any.whl (8.0 kB view hashes)

Uploaded Python 3

Supported by

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