Apify badge assignment for badgecollector.org via GitHub repository_dispatch or the relay Worker.
Project description
badgecollector
Python client for badgecollector.org — apify badge assignment via GitHub repository_dispatch or the relay Cloudflare Worker.
Stdlib only. No requests, no httpx. Python 3.8+.
Install
pip install badgecollector
Use
Two auth modes — pick one per call.
Worker path (recommended)
A bk_* key from the register-client workflow plus the Worker URL.
import os
from badgecollector import award_badge
result = award_badge(
api_key=os.environ["BC_API_KEY"],
worker_url="https://badgecollector-worker.sirmmo.workers.dev",
badge_id="early-adopter",
email="user@example.com", # hashed locally; never sent
expires_at="2027-06-09T00:00:00Z",
evidence="https://example.com/transcript",
)
print(result["recipient_page"])
Direct dispatch
A GitHub PAT with Actions: write + Contents: read on the repo.
result = award_badge(
token=os.environ["GH_TOKEN"],
badge_id="early-adopter",
email="user@example.com",
client_id="acme-corp",
)
API
hash_email(email: str) -> str
# SHA-256 hex of nfc(lowercase(trim(email))).
award_badge(*, badge_id, email=None, email_hash=None,
api_key=None, worker_url=None, token=None,
expires_at=None, evidence=None, client_id=None,
owner="sirmmo", repo="badgecollector") -> dict
await_award_completion(*, token, triggered_at,
owner="sirmmo", repo="badgecollector",
timeout_s=120.0, interval_s=4.0) -> dict
# Raises AwardError on upstream rejection, ValueError on invalid input.
See CLAUDE.md for the full system specification.
License
MIT
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file badgecollector-0.1.0.tar.gz.
File metadata
- Download URL: badgecollector-0.1.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f562bbeff8f54f270fb42a41de96c709465d9fd67e3ead6174dabf471c28b35
|
|
| MD5 |
7edc08774d29447e37b1dd474c20745b
|
|
| BLAKE2b-256 |
e12897d6fe03084a8ccb4444480e0a1c4a561359c62bd95bb61c31fb540235a1
|
Provenance
The following attestation bundles were made for badgecollector-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on sirmmo/badgecollector
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
badgecollector-0.1.0.tar.gz -
Subject digest:
4f562bbeff8f54f270fb42a41de96c709465d9fd67e3ead6174dabf471c28b35 - Sigstore transparency entry: 1769877106
- Sigstore integration time:
-
Permalink:
sirmmo/badgecollector@2b03d7d0d491e93c35420b2fe85253c62750c65f -
Branch / Tag:
refs/tags/py-v0.1.0 - Owner: https://github.com/sirmmo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@2b03d7d0d491e93c35420b2fe85253c62750c65f -
Trigger Event:
push
-
Statement type:
File details
Details for the file badgecollector-0.1.0-py3-none-any.whl.
File metadata
- Download URL: badgecollector-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
315d7f4c1d4bfebd00a3021c1f3704ca301b3869fcab4c26ce1e0b2f78a3c823
|
|
| MD5 |
96c58786d38fc2ddec869255ea2d78d4
|
|
| BLAKE2b-256 |
f403b63c93225ea66a0dbae9c7674462e81b6a3140bd1ff31034bb0ef0ea324a
|
Provenance
The following attestation bundles were made for badgecollector-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on sirmmo/badgecollector
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
badgecollector-0.1.0-py3-none-any.whl -
Subject digest:
315d7f4c1d4bfebd00a3021c1f3704ca301b3869fcab4c26ce1e0b2f78a3c823 - Sigstore transparency entry: 1769877369
- Sigstore integration time:
-
Permalink:
sirmmo/badgecollector@2b03d7d0d491e93c35420b2fe85253c62750c65f -
Branch / Tag:
refs/tags/py-v0.1.0 - Owner: https://github.com/sirmmo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@2b03d7d0d491e93c35420b2fe85253c62750c65f -
Trigger Event:
push
-
Statement type: