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.
Metadata
Release files for certificate-generator 0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| certificate_generator-0.3.tar.gz | 298.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| certificate_generator-0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 596.1 kB
Release files / certificate_generator-0.3.tar.gz
| Download URL | certificate_generator-0.3.tar.gz |
|---|---|
| Size | 298.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
762cd4c6d97d8cbfac301ea94a4789a14bde03abc456c97d7e9441a1f619a324
|
|
BLAKE2b-256 checksum How to use checksums |
1a2fdec9be3f1a67fc0cd52010ea9f15872f5c9fc8330a09ddf3cfb75f74ea8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.19
|
Release files / certificate_generator-0.3-py3-none-any.whl
| Download URL | certificate_generator-0.3-py3-none-any.whl |
|---|---|
| Size | 297.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c758de13283281b038d71b71281c32044c657bdd7fc93e6b92045ff05bf7e41c
|
|
BLAKE2b-256 checksum How to use checksums |
ed9ade0d59d5fcb80ea96ef1e115e9405097dc54cedb901d501841e5facce652
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.19
|