From a349c0deeccc4a2e0d441cb8a6ac883bc8651b8c Mon Sep 17 00:00:00 2001 From: sherlock Date: Thu, 17 Apr 2025 00:15:09 +0530 Subject: [PATCH] Added readme and init --- README.md | 33 +++++++++++++++++++++++++++++++++ init.sh | 4 ++++ requirements.txt | 1 + 3 files changed, 38 insertions(+) create mode 100755 init.sh create mode 100644 requirements.txt diff --git a/README.md b/README.md index e69de29..7f89be4 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,33 @@ +# The Image Certificate Maker + +Making certificates for a large quantity of participants can be a tedious task for an event. This tool automates the process of creating certificates in bulk, saving time and effort. + +## Usage +- Clone the repo, and `cd` into it. +- Run `init.sh` to initiate the environment. This installs `uv`, and installs `pillow` as the dependency, and activates the virtual environment. +```bash +chmod +x init.sh +./init.sh +``` +- In the repo folder, add a `participants.csv` where the names are listed under the `name` column. +- Add `cert.jpg` or `cert.png` to the folder, depending on which format you want to use. +- Import the font of your liking into the folder, and specify the filename under `font_path = ""` +- Run the script using uv. + +For JPEG, Run +```bash +uv run jpeg.py +``` + +For PNG, Run +```bash +uv run png.py +``` + +This generates a `certificates` folder. + +**NOTE**: If your certificate does not have names right in the center, you might have to adjust the y offset in the script. Moreover, if the name is too long, you might have to modify font sizes as well. + +Multithreading ensures that the process is faster. + +Made by Aadit Agrawal, 2025 diff --git a/init.sh b/init.sh new file mode 100755 index 0000000..8112e88 --- /dev/null +++ b/init.sh @@ -0,0 +1,4 @@ +curl -LsSf https://astral.sh/uv/install.sh | sh; +uv pip install pillow; +uv venv; +source .venv/bin/activate; diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..05cb513 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +pillow=11.2.1