From 79b11c27ef909a171f46aefdadbec6fec6a87b20 Mon Sep 17 00:00:00 2001 From: Stu Leak Date: Tue, 4 Nov 2025 05:04:53 -0500 Subject: [PATCH] Fix packaging and ensure __main__.py exports main() --- core/__init__.py | 6 ++++++ core/config.py | 24 ++++++++++++++++++++++++ pyproject.toml | 2 +- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/core/__init__.py b/core/__init__.py index e69de29..e132bb2 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -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 " diff --git a/core/config.py b/core/config.py index e69de29..f4b1509 100644 --- a/core/config.py +++ b/core/config.py @@ -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() diff --git a/pyproject.toml b/pyproject.toml index fc1c055..d50d44e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] 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)." readme = "README.md" requires-python = ">=3.8"