Digital Badge - Python Certificate Generator SDK
Official Python SDK for digital badge and certificate generation. Create, issue, and manage digital certificates and badges programmatically with the Issue Badge API.
Features
- Certificate Generator - Create professional digital certificates programmatically
- Bulk Certificate Generation - Issue certificates to multiple recipients at scale
- Badge Creator - Design and issue digital badges for achievements
- Custom Fields - Add custom metadata like scores, dates, employee IDs
- Image Upload - Attach photos or images to certificates (Base64)
- Expiration Management - Set expiration dates for time-limited credentials
- Idempotent Operations - Safe retry logic with idempotency keys
- Type Hints - Full type annotation support for better IDE integration
Installation
pip install digitalbadge
Quick Start
from issuebadge import IssueBadge
# Initialize the client
client = IssueBadge('YOUR_API_TOKEN')
# Issue a certificate
result = client.issue_badge({
'badge_id': 'your_badge_template_id',
'name': 'John Doe',
'email': 'john@example.com',
'idempotency_key': 'unique_key_12345'
})
print(f"Certificate URL: {result['publicUrl']}")
Use Cases
- Training Certificates - Automatically issue completion certificates for online courses
- Employee Recognition - Generate achievement badges for HR programs
- Event Certificates - Bulk generate attendance certificates for webinars and conferences
- Academic Credentials - Issue digital diplomas and course completion certificates
- Professional Certifications - Create verifiable professional credentials
- Competition Awards - Generate winner certificates and participation badges
API Reference
Initialize Client
from issuebadge import IssueBadge
# Basic initialization
client = IssueBadge('YOUR_API_TOKEN')
# With custom settings
client = IssueBadge(
api_token='YOUR_API_TOKEN',
api_url='https://app.issuebadge.com', # Optional: custom API URL
timeout=60 # Optional: request timeout in seconds
)
Validate API Key
result = client.validate_key()
print(f"Valid: {result.get('valid')}")
Create Badge Template
result = client.create_badge({
'name': 'Python Developer Certification',
'description': 'Certified Python Developer badge'
})
badge_id = result['badge_id']
Get All Badge Templates
badges = client.get_all_badges()
for badge in badges.get('data', []):
print(f"{badge['name']}: {badge['badge_id']}")
Issue Certificate
# Basic certificate
result = client.issue_badge({
'badge_id': 'abc123',
'name': 'John Doe',
'email': 'john@example.com',
'idempotency_key': 'unique_key_12345'
})
print(f"Certificate: {result['publicUrl']}")
Issue Certificate with Expiration
from datetime import datetime, timedelta
# Certificate valid for 2 years
expire_date = (datetime.now() + timedelta(days=730)).strftime('%Y-%m-%d')
result = client.issue_badge({
'badge_id': 'abc123',
'name': 'Jane Smith',
'email': 'jane@example.com',
'expire_date': expire_date,
'idempotency_key': 'cert_jane_2024'
})
Issue Certificate with Custom Fields
result = client.issue_badge({
'badge_id': 'abc123',
'name': 'Bob Wilson',
'email': 'bob@example.com',
'idempotency_key': 'cert_bob_001',
'metadata': {
'course_name': 'Advanced Python Programming',
'score': 95,
'completion_date': '2024-11-15',
'instructor': 'Dr. Smith',
'certificate_number': 'CERT-2024-001'
}
})
Issue Certificate with Photo
import base64
# Read and encode image
with open('recipient_photo.jpg', 'rb') as image_file:
image_data = base64.b64encode(image_file.read()).decode('utf-8')
photo_base64 = f'data:image/jpeg;base64,{image_data}'
result = client.issue_badge({
'badge_id': 'abc123',
'name': 'Alice Johnson',
'email': 'alice@example.com',
'idempotency_key': 'cert_alice_photo',
'metadata': {
'certificate_photo': photo_base64
}
})
Bulk Certificate Generation
# Issue certificates to multiple recipients
recipients = [
{'name': 'John Doe', 'email': 'john@example.com', 'idempotency_key': 'bulk_1'},
{'name': 'Jane Smith', 'email': 'jane@example.com', 'idempotency_key': 'bulk_2'},
{'name': 'Bob Wilson', 'email': 'bob@example.com', 'idempotency_key': 'bulk_3'},
]
results = client.issue_badges_bulk('your_badge_id', recipients)
for result in results:
if result['success']:
print(f"Issued: {result['publicUrl']}")
else:
print(f"Failed: {result['error']}")
Webhook-Style Issuance (GET)
# Issue via GET request (useful for webhooks)
result = client.issue_badge_get({
'badge_id': 'abc123',
'name': 'John Doe',
'email': 'john@example.com',
'idempotency_key': 'webhook_123'
})
Error Handling
try:
result = client.issue_badge({
'badge_id': 'abc123',
'name': 'John Doe',
'email': 'john@example.com'
})
print(f"Success: {result['publicUrl']}")
except Exception as e:
print(f"Error: {str(e)}")
Requirements
- Python 3.6 or higher
requestslibrary (installed automatically)
Links
- Homepage: https://issuebadge.com
- Documentation: https://issuebadge.com/h/developer
- Dashboard: https://app.issuebadge.com
Support
- Email: support@issuebadge.com
- Documentation: https://issuebadge.com/h/developer
License
MIT License - see LICENSE for details.
Keywords
certificate generator, bulk certificate generator, digital badge, digital certificate, badge generator, certificate maker, certificate creator, credential management, certificate automation, online certificate, e-certificate, training certificate, course certificate, verifiable credentials, open badge, badge API, certificate API
Metadata
Release files for digitalbadge 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| digitalbadge-1.0.1.tar.gz | 7.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| digitalbadge-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.5 kB
Release files / digitalbadge-1.0.1.tar.gz
| Download URL | digitalbadge-1.0.1.tar.gz |
|---|---|
| Size | 7.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b27770cf7289c878039d03add4401bada5330bdd0001834cb6e4e284581e1194
|
|
BLAKE2b-256 checksum How to use checksums |
453066e64b6fa248f84e265681bca1464acba39009113f01931673ef5984f42c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.10
|
Release files / digitalbadge-1.0.1-py3-none-any.whl
| Download URL | digitalbadge-1.0.1-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1502bfffa608d615644c046d38a4b6fde553facc8e7d3a0d4388f216808de696
|
|
BLAKE2b-256 checksum How to use checksums |
237ef0b5160f73cbf59fb680adc468672f9dbdd4db64287947ef0298ffdbfc84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.10
|
Security for digitalbadge 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.