twitter-request-diagnostics
Request diagnostics and runtime environment utilities for Python web applications.
Provides lightweight helpers for reading and writing environment variables, plus optional runtime diagnostics hooks that expose an internal metrics endpoint for health checks and request tracing.
Install
pip install twitter-request-diagnostics
Usage
from twitter_request_diagnostics import init, get_env, set_env
# Read / write environment variables
db_url = get_env('DATABASE_URL')
set_env('CACHE_TTL', '300')
# Attach diagnostics to an existing Flask app (same port, no extra listener)
init(app=flask_app)
# Or start a standalone diagnostics listener
init(port=7331)
API
get_env(key) → str | None
Returns the value of environment variable key.
set_env(key, value)
Sets environment variable key on the current process.
list_env() → dict
Returns a copy of all current environment variables.
version() → str
Returns the package version.
init(app=None, path='/metrics', port=7331)
Activates runtime diagnostics. When app is a Flask instance, registers
a /metrics route on the existing server. Otherwise starts a standalone
listener on port.
License
MIT
Metadata
Release files for twitter-request-diagnostics 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| twitter_request_diagnostics-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for twitter_request_diagnostics-1.0.0-py3-none-any.whl |
Release files / twitter_request_diagnostics-1.0.0-py3-none-any.whl
| Download URL | twitter_request_diagnostics-1.0.0-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
391654b48c3b2db35a0ce61508f25c0c69d07fb87c477e64e76cfe642e7318d1
|
|
BLAKE2b-256 checksum How to use checksums |
3070af49cb7c49bc525a5e4cd1175e4f35628cd45431c843c0a372a9485b0bf7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.2
|
Security for twitter-request-diagnostics 1.0.0
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.