A package to generate certificates with a given name and a logo in the top middle.
Project description
Certificate Generator
A Python package to generate certificates with a given name and a logo in the top middle.
Features
- Generate certificates with a specified template.
- Add a custom logo to the top middle of the certificate.
- Customize the font and color of the text.
- Save generated certificates as PNG files.
Installation
You can install the package from PyPI using pip:
pip install certificate_generator
Usage
Basic Usage
To generate certificates, you need a template image, a font file, and a logo image. Here's an example of how to use the package:
from certificate_generator import CertificateGenerator
template_path = 'path/to/template.png'
font_path = 'path/to/font/GreatVibes-Regular.ttf'
logo_path = 'path/to/logo.png'
generator = CertificateGenerator(template_path, font_path, logo_path)
# Example names
names = ["Alice", "Bob", "Charlie"]
for name in names:
generator.create_certificate(name)
Command Line Usage
You can also generate certificates using the command line. Make sure you have a names.txt
file with each name on a new line:
generate-certificates
Customization
You can customize the font size and color when creating the CertificateGenerator
instance:
generator = CertificateGenerator(template_path, font_path, logo_path, font_size=150, font_color="#000000")
Output Directory
By default, the certificates are saved in an out
directory. You can specify a different output directory:
generator.create_certificate(name, output_dir="./custom_output/")
Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Tushar Nankani - Main author of the basic script
Acknowledgements
- Pillow - The friendly PIL fork.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file certificate_generator-0.3.tar.gz
.
File metadata
- Download URL: certificate_generator-0.3.tar.gz
- Upload date:
- Size: 298.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 762cd4c6d97d8cbfac301ea94a4789a14bde03abc456c97d7e9441a1f619a324 |
|
MD5 | 9f8e3c412b0e1055fd82cd6e1259a060 |
|
BLAKE2b-256 | 1a2fdec9be3f1a67fc0cd52010ea9f15872f5c9fc8330a09ddf3cfb75f74ea8a |
File details
Details for the file certificate_generator-0.3-py3-none-any.whl
.
File metadata
- Download URL: certificate_generator-0.3-py3-none-any.whl
- Upload date:
- Size: 297.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c758de13283281b038d71b71281c32044c657bdd7fc93e6b92045ff05bf7e41c |
|
MD5 | 42a348863478b5e7bef55df25629c1cd |
|
BLAKE2b-256 | ed9ade0d59d5fcb80ea96ef1e115e9405097dc54cedb901d501841e5facce652 |