Skip to main content

AdmitiQ

PyPI npm License: MIT

Signed, expiring, revocable tokens for QR codes and ticket links.

A LogicLitz open-source project · Site: admitiq.logiclitz.org

Website & tutorial https://admitiq.logiclitz.org
Admission policies https://admitiq.logiclitz.org/guides/admission-policies
Token playground https://admitiq.logiclitz.org/debugger
Organization https://logiclitz.org
Source https://github.com/HyperXfury1873/admitiq
JavaScript twin npm install admitiq

A QR code is just text with better marketing. AdmitiQ puts an HMAC-signed (or ES256) token under the QR or inside a URL so a scan can prove: we issued it, it hasn’t expired, and — when you choose — how many times it may be admitted.

Admission policies (v0.4+)

Policy Python JavaScript Typical use
Unlimited while valid verify_pass verifyPass Halls, workshops, staff badges
Once per calendar day admit_daily admitDaily Main gate; go home, return tomorrow
Once ever admit_once admitOnce Coupons, single-session tickets

Same QR for a multi-day event: halls call verify_pass; the main gate calls admit_daily.

Tokens are cross-language: issue in Python, verify in Node (and the reverse) with the same secret.


Install

pip install admitiq

# optional extras
pip install "admitiq[qr]"     # QR images (qrcode + Pillow)
pip install "admitiq[ec]"     # ES256 / cryptography
pip install "admitiq[redis]"  # Redis single-use / revoke store

Quick start

from admitiq import issue, verify, issue_url, issue_qr
import os

SECRET = os.environ["ADMITIQ_SECRET"]  # keep on the server only

token = issue({"ticket_id": "T-1001", "seat": "A12"}, ttl_seconds=3600, secret=SECRET)
url = issue_url(
    "https://events.example/scan",
    {"ticket_id": "T-1001"},
    ttl_seconds=3600,
    secret=SECRET,
)
# issue_qr(..., output_path="ticket.png")  # needs admitiq[qr]

payload = verify(token, secret=SECRET)
print(payload["data"])  # {"ticket_id": ..., "seat": ...}

FastAPI / Flask helpers

from admitiq.frameworks import fastapi_dependency, flask_require_token

See the Python guide and the Flask attendance example.

Key rotation

from admitiq import verify_with_secrets
payload = verify_with_secrets(token, secrets=[NEW_SECRET, OLD_SECRET])

Multi-day badge + main gate

from admitiq import issue, verify_pass, admit_daily
from admitiq.stores import MemoryRevocationStore  # or Redis / Hosted

token = issue({"attendee_id": "A42"}, ttl_seconds=2 * 86400, secret=SECRET)
store = MemoryRevocationStore()
verify_pass(token, SECRET)                      # halls: unlimited
admit_daily(token, SECRET, store)               # main gate: once per day

ES256 (untrusted scanners)

from admitiq.ec import generate_keypair, issue, verify
private_pem, public_pem = generate_keypair()
token = issue({"ticket_id": "T-1001"}, ttl_seconds=3600, private_key_pem=private_pem)
verify(token, public_key_pem=public_pem)  # scanner holds public key only

Docs & guides

Resource URL
Interactive tutorial https://admitiq.logiclitz.org/tutorial
Admission policies (pass / daily / once) https://admitiq.logiclitz.org/guides/admission-policies
Issue & verify playground https://admitiq.logiclitz.org/debugger
Getting started https://admitiq.logiclitz.org/getting-started
Python guide https://github.com/HyperXfury1873/admitiq/blob/main/docs/python.md
Delivering tokens (QR / URL) https://github.com/HyperXfury1873/admitiq/blob/main/docs/delivering-tokens.md
Key rotation https://github.com/HyperXfury1873/admitiq/blob/main/docs/key-rotation.md
Security model https://github.com/HyperXfury1873/admitiq/blob/main/SECURITY.md
Flask example https://github.com/HyperXfury1873/admitiq/tree/main/examples/flask-attendance
What is AdmitiQ? https://github.com/HyperXfury1873/admitiq/blob/main/docs/what-is-admitiq.md

Project links

These also appear in the PyPI sidebar:

License

MIT © LogicLitz

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

admitiq-0.4.0.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

admitiq-0.4.0-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file admitiq-0.4.0.tar.gz.

File metadata

  • Download URL: admitiq-0.4.0.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.2

File hashes

Hashes for admitiq-0.4.0.tar.gz
Algorithm Hash digest
SHA256 c6a68fc0e9061dab5fb8260321ed267746c02607428217f44aae0082bdaf1648
MD5 ee908dbcce87a882e170449a62141366
BLAKE2b-256 ddd6e73e006cf8cc6b0dad5504adc21f7e009b4f3460b0483173cb664fe0787d

See more details on using hashes here.

File details

Details for the file admitiq-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: admitiq-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.2

File hashes

Hashes for admitiq-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 51038891d3b8a780d9a783c267637c143227dc0f9736ebc24b420f06ee2553c5
MD5 ca25b6e008cb2f3f32189ffcb9f13579
BLAKE2b-256 dc7ca72e26fd651c231609ff9524add3bbed631bba05cd163efeab8cee35ee02

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page