DevKitX
Security-first Python utilities for government, healthcare, and financial applications.
Why DevKitX?
Most Python utility libraries optimize for convenience. DevKitX optimizes for security and compliance.
| Feature | Generic Libraries | DevKitX |
|---|---|---|
| HTTP timeouts | Optional | Enforced by default |
| Secret detection | Not included | Built-in scanner |
| Audit logging | DIY | NIST AU-3 compliant |
| PII detection | Not included | Automatic scanning |
| Config secrets | Mixed with config | Env-only pattern enforced |
Quick Start
pip install devkitx
# Scan for hardcoded secrets
devkitx audit secrets ./src
# Scan for PII
devkitx audit pii ./data
# Check dependencies for CVEs
devkitx audit deps
For Developers
from devkitx.security import SecretsScanner
from devkitx.compliance import AuditLogger, PIIDetector
# Audit logging that meets NIST 800-53 AU controls
logger = AuditLogger(service="my-api")
logger.log_auth("user_login", user_id="123", outcome="success")
# Scan uploads for PII before storage
detector = PIIDetector()
matches = detector.scan_text(user_input)
if matches:
raise ValueError(f"PII detected: {[m.pii_type for m in matches]}")
Micro-Packages
Need just one feature? Install the standalone packages:
pip install asyncbridge # Async/sync conversion
pip install httpx-defaults # Production-ready HTTP client
pip install confmerge # Multi-format config loading
Compliance Mapping
DevKitX features map to common compliance frameworks:
| DevKitX Feature | NIST 800-53 | SOC 2 | HIPAA |
|---|---|---|---|
| AuditLogger | AU-2, AU-3, AU-9 | CC7.2 | 164.312(b) |
| SecretsScanner | SA-3, SC-28 | CC6.1 | 164.312(a)(1) |
| PIIDetector | SI-12, PM-25 | CC6.5 | 164.514 |
| SecureClient | SC-8, SC-13 | CC6.6 | 164.312(e)(1) |
Installation
Main Package
# Basic installation
pip install devkitx
# With CLI support
pip install devkitx[cli]
# With all features
pip install devkitx[all]
Micro-Packages
# Zero-dependency async/sync conversion
pip install asyncbridge
# Production HTTP client with secure defaults
pip install httpx-defaults
# Multi-format config loading
pip install confmerge
Features
🔒 Security & Compliance
- Secrets Scanner: Detect hardcoded API keys, passwords, tokens
- PII Detector: Find personally identifiable information in text/files
- Audit Logger: NIST 800-53 AU-3 compliant structured logging
- Input Sanitization: Prevent XSS, SQL injection, path traversal
🌐 Secure HTTP
- Production Defaults: Timeouts, connection limits, retry logic
- Security Warnings: Alert on insecure HTTP usage
- Certificate Verification: Enforced by default
⚙️ Configuration
- Multi-format Support: JSON, YAML, TOML, .env files
- Secret Detection: Warn when secrets found in config files
- Environment Integration: Secure environment variable handling
⚡ Async/Sync Bridges
- Zero Dependencies: Pure stdlib implementation
- Event Loop Safe: Proper handling of running loops
- Thread Pool: Non-blocking sync function execution
🛠️ CLI Tools
- Security Auditing:
devkitx audit secrets,devkitx audit pii - Dependency Scanning:
devkitx audit deps - Project Scaffolding:
devkitx init my-project - Utility Commands: JSON, string, config operations
CLI Usage
# Install with CLI support
pip install devkitx[cli]
# Security auditing
devkitx audit secrets ./src # Scan for hardcoded secrets
devkitx audit pii ./data # Scan for PII
devkitx audit deps # Check for vulnerable dependencies
# Project management
devkitx init my-secure-project # Create project with secure defaults
# Utilities
devkitx json flatten config.json # Flatten nested JSON
devkitx string convert "MyClass" --to snake # Convert case formats
API Examples
Audit Logging
from devkitx.compliance import AuditLogger
# Initialize logger for your service
logger = AuditLogger(service="user-api")
# Log authentication events
logger.log_auth(
action="login",
user_id="user123",
outcome="success",
source_ip="192.168.1.100"
)
# Log data access
logger.log_access(
action="read",
resource_type="user_profile",
resource_id="profile456",
user_id="user123"
)
# Log data changes with diff
logger.log_change(
action="update",
resource_type="user_profile",
resource_id="profile456",
user_id="user123",
changes={"email": {"old": "old@example.com", "new": "new@example.com"}}
)
Security Scanning
from devkitx.security import SecretsScanner
from devkitx.compliance import PIIDetector
# Scan for hardcoded secrets
scanner = SecretsScanner()
for secret in scanner.scan_directory("./src"):
print(f"🚨 {secret.secret_type} found in {secret.file_path}:{secret.line_number}")
print(f" Severity: {secret.severity}")
print(f" Value: {secret.redacted}")
# Scan for PII
detector = PIIDetector()
text = "Contact John Doe at john.doe@company.com or 555-123-4567"
for match in detector.scan_text(text):
print(f"PII detected: {match.pii_type} = {match.redacted}")
Secure HTTP Client
from devkitx import SecureClient
# HTTP client with production-ready defaults
with SecureClient() as client:
# Automatic timeouts, connection limits, security warnings
response = client.get("https://api.example.com/data")
data = response.json()
# Async version
from devkitx import SecureAsyncClient
async def fetch_data():
async with SecureAsyncClient() as client:
response = await client.get("https://api.example.com/data")
return response.json()
Configuration Management
from devkitx import load_config, merge_config
# Load and merge multiple config sources
config = load_config(
"config.yaml", # Base configuration
"config.local.yaml", # Local overrides
env_prefix="APP_" # Environment variables (APP_*)
)
# Access nested configuration
db_host = config.get("database.host", "localhost")
Async/Sync Conversion
from devkitx import async_to_sync, sync_to_async
# Convert async function to sync
async def fetch_user(user_id):
# ... async database call
return user
get_user = async_to_sync(fetch_user)
user = get_user(123) # Works in sync context
# Convert sync function to async (runs in thread pool)
def expensive_calculation(data):
# ... CPU intensive work
return result
async_calc = sync_to_async(expensive_calculation)
result = await async_calc(data) # Non-blocking
Compliance Features
NIST 800-53 Controls
DevKitX helps implement several NIST 800-53 security controls:
- AU-2 (Audit Events): AuditLogger identifies auditable events
- AU-3 (Content of Audit Records): Structured logging with required fields
- AU-9 (Protection of Audit Information): Tamper-evident audit chains
- SA-3 (System Development Life Cycle): Security scanning in development
- SC-8 (Transmission Confidentiality): Secure HTTP defaults
- SC-28 (Protection of Information at Rest): Secret detection
- SI-12 (Information Handling): PII detection and handling
- PM-25 (PII Minimization): Automated PII discovery
SOC 2 Type II
- CC6.1 (Logical Access): Secret scanning prevents credential exposure
- CC6.5 (Data Classification): PII detection supports data classification
- CC6.6 (Data Transmission): Secure HTTP client protects data in transit
- CC7.2 (System Monitoring): Audit logging provides security monitoring
HIPAA Compliance
- 164.312(a)(1) (Access Control): Secret scanning prevents unauthorized access
- 164.312(b) (Audit Controls): Audit logging tracks access to PHI
- 164.312(e)(1) (Transmission Security): Secure HTTP protects PHI in transit
- 164.514 (De-identification): PII detection helps identify PHI
Requirements
- Python 3.10+
- Core dependencies: asyncbridge, httpx-defaults, confmerge
License
MIT License - Free for commercial use
Security
For security vulnerabilities, please email security@serityops.com instead of creating public issues.
Built for regulated environments. Trusted by government, healthcare, and financial organizations.
Metadata
Release files for devkitx 2.0.1
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 | |
|---|---|---|---|---|
| devkitx-2.0.1.tar.gz | 20.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| devkitx-2.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 43.1 kB
Release files / devkitx-2.0.1.tar.gz
| Download URL | devkitx-2.0.1.tar.gz |
|---|---|
| Size | 20.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6c06fef53e61cb39bc14c97bd7b238a57d94baf8a30c0088cc5d1d9b8bba86f0
|
|
BLAKE2b-256 checksum How to use checksums |
b8b3558d84515da3be50e13745e2b854130c0c2b2c5ff24daefe9f9fdc575c1c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / devkitx-2.0.1-py3-none-any.whl
| Download URL | devkitx-2.0.1-py3-none-any.whl |
|---|---|
| Size | 22.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
32b6483ae5459f7cacf424a4c9752807fda027a7ba67d2a78e99e39e52cc3ec1
|
|
BLAKE2b-256 checksum How to use checksums |
8bd3480075a8d48d61ed0150932112f941febd70b8b562972a7b1003cb0b012f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Security for devkitx 2.0.1
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.