LITERP TIER TWO CREDENTIAL LIBRARY
Dependencies
- pyjwt
- captcha
- requests
- python-jose
- python-dotenv
Environment Variables
- TELEGRAM_BOT_TOKEN: Got from @BotFather.
- DISCORD_BOT_TOKEN: Got from Discord Developer Portal.
- WHATSAPP_API_TOKEN: Got from Meta Cloud API.
- WHATSAPP_PHONE_ID: Meta phone number ID for WhatsApp sender.
- JWT_SECRET: Any strong random string for signing JWT tokens.
- SETUPKEY_ENCRYPT_SECRET: any strong random string for encrypting setup-key.
- TOKEN_EXPIRE_MINUTES: JWT token expiration time in minutes.
- GOOGLE_AUTHENTICATOR_SETUP_KEY: Google authenticator secret key.
Utility Functions
create_random_id(user_name, id_length, id_timeout)
Generate a random digit-only ID of id_length characters, embed it with user_name in a JWT that expires after id_timeout seconds.
- Parameters:
user_name: Unique identifier for the user (e.g. email, username).
id_length: Number of digits in the ID (default 6).
id_timeout: Token lifetime in seconds (default 60). - Returns: a plain digit ID.
verify_given_id(user_name, id_string)
Verify that id_string matches the active, non-expired token stored for user_name.
- Parameters:
user_name: The user whose token to look up.
id_string: The digit ID to verify. - Returns: True when token found, not expired, and ID matches. False when token missing, expired, or ID mismatch.
verify_google_code(code)
Verify that code got from Google Authenticator App matches user's secret key.
- Parameters:
code: A time-based code got from Google Authenticator App. - Returns: True on success. False on failure.
text_to_telegram(message, recipient)
Send message to a Telegram user or chat.
- Parameters:
message: Text to send.
recipient: Telegram chat_id (numeric string), got by messaging @userinfobot on Telegram. - Returns: True on success. False on failure.
text_to_discord(message, recipient)
Send message to a Discord user via DM.
- Parameters:
message: Text to send.
recipient: Discord user ID (numeric string), got from Discord Developer Mode. - Returns: True on success. False on failure.
text_to_whatsapp(message, recipient)
Send message to a WhatsApp number via Meta Cloud API. Deprecated.
- Parameters:
message: Text to send.
recipient: Recipient's phone number in E164 format. - Returns: True on success. False on failure.
get_active_token(user_name)
Return the raw JWT for user_name, or None if not found.
invalidate_token(user_name)
Manually invalidate/delete the token for user_name.
generate_access_token(user_name)
Generate JWT access token for user_name.
verify_access_token(access_token, user_name)
Validate the access_token (generated by generate_access_token) for user_name.
Detailed Info
Detailed tips, tricks, and examples, can be found at project's repository https://github.com/asinerum/tier2
(C) 2026 Asinerum Conlang Project
Metadata
Release files for tier2 1.0.10
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 | Actions |
|---|---|---|---|---|
| tier2-1.0.10.tar.gz | 9.2 kB | Without provenance | Details for tier2-1.0.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tier2-1.0.10-py3-none-any.whl | Python 3 | none | any | Details for tier2-1.0.10-py3-none-any.whl |
Total release size: 18.3 kB
Release files / tier2-1.0.10.tar.gz
| Download URL | tier2-1.0.10.tar.gz |
|---|---|
| Size | 9.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0542d57c9db959de791a79283b98b52f62b454262b8d77e074b9bc2c962dad1c
|
|
BLAKE2b-256 checksum How to use checksums |
9ff03d9cac94299adba77937b5ecae072655c69502010059c633304bb6ae9924
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.9
|
Release files / tier2-1.0.10-py3-none-any.whl
| Download URL | tier2-1.0.10-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a49589785851bacfe85e734810f657f9704e4645f82fcb8c16b3670237f175fc
|
|
BLAKE2b-256 checksum How to use checksums |
1ff97d61413ae48ccf7de4e3f2096eecb184138b25b21892ab7067470358f312
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.9
|
Security for tier2 1.0.10
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.