New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

twitter-request-diagnostics

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Malware was recently detected in this package.

Affected versions:

1.0.0

twitter-request-diagnostics

Request diagnostics and runtime environment utilities for Python web applications

pipPyPI
Version
1.0.0
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created

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

Keywords

diagnostics

FAQs

Related posts