Fix packaging and ensure __main__.py exports main()

This commit is contained in:
Stu Leak 2025-11-04 05:04:53 -05:00
parent e2c1cf1921
commit 79b11c27ef
3 changed files with 31 additions and 1 deletions

View File

@ -0,0 +1,6 @@
"""
img2pdf - Leak Technologies
Convert a single image or folder of images into a PDF file (sorted by filename).
"""
__version__ = "1.0.3"
__author__ = "Stu Leak <leaktechnologies@proton.me>"

View File

@ -0,0 +1,24 @@
import argparse
from pathlib import Path
def parse_arguments():
parser = argparse.ArgumentParser(
description="Convert an image or folder of images into a PDF file."
)
parser.add_argument(
"input_path",
type=str,
help="Path to an image file or a folder containing images.",
)
parser.add_argument(
"-o", "--output",
type=str,
required=True,
help="Output PDF file path.",
)
parser.add_argument(
"--overwrite",
action="store_true",
help="Overwrite the output file if it already exists.",
)
return parser.parse_args()

View File

@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "img2pdf" name = "img2pdf"
version = "1.0.3" version = "1.0.4"
description = "Convert a single image or folder of images into a PDF file (sorted by filename)." description = "Convert a single image or folder of images into a PDF file (sorted by filename)."
readme = "README.md" readme = "README.md"
requires-python = ">=3.8" requires-python = ">=3.8"