certificates

raw JSON →
2.3.3 verified Fri May 01 auth: no python

A Python library for generating event certificates easily. Version 2.3.3 supports Python >=3.12, with a simple API to create PDF certificates from templates or data models. Active development on GitHub.

pip install certificates
error ModuleNotFoundError: No module named 'certificates'
cause The library is not installed or virtual environment not activated.
fix
Run pip install certificates in your project environment.
error TypeError: Certificate.__init__() missing 1 required positional argument: 'template'
cause Since version 2.3.0, `template` is a required parameter.
fix
Provide a template argument: Certificate(..., template='modern').
error AttributeError: module 'certificates' has no attribute 'event'
cause The submodule `event` was removed in 2.3.0; classes moved to top-level.
fix
Use from certificates import CertificateEvent instead.
breaking In version 2.3.0, the API was restructured: `Certificate` now requires a `template` argument (string). Omitting it will raise a TypeError.
fix Pass `template='modern'` or another valid template name.
deprecated The `from certificates.event import CertificateEvent` import path is deprecated since 2.3.0. Use `from certificates import CertificateEvent` instead.
fix Change import to `from certificates import CertificateEvent`.
gotcha The library requires Python >=3.12. Installing on older Python versions will fail.
fix Ensure Python 3.12 or higher is used.

Create a basic certificate with default template and save as PDF.

from certificates import Certificate
from datetime import datetime

cert = Certificate(
    name="Jane Doe",
    event="PyCon 2024",
    date=datetime(2024, 5, 10),
    template="modern"
)
cert.generate("jane_doe_certificate.pdf")
print("Certificate generated!")