pdf-accessibility/test_env.py
DJP bf83a409bb Initial commit: Enterprise PDF Accessibility Checker
- Complete WCAG 2.1 accessibility checking system
- AI-powered analysis with Claude 4.5 and Google Vision
- Web interface with drag-and-drop upload
- REST API backend (PHP)
- Python checker with parallel processing
- Quick mode for fast scans (~10 seconds)
- Full mode with AI analysis (~2 minutes)
- .env file support for API keys
- Error logging and debugging tools
- Comprehensive documentation

Performance improvements:
- Parallel image processing (3x faster)
- Smart API timeouts (10s)
- Reduced DPI for faster conversions
- Real-time progress updates

🤖 Generated with Claude Code
2025-10-20 15:50:56 -04:00

61 lines
1.8 KiB
Python
Executable file

#!/usr/bin/env python3
"""
Test script to verify .env file is being loaded correctly
"""
import os
import sys
# Load environment variables from .env file (optional)
try:
from dotenv import load_dotenv
load_dotenv()
print("✅ python-dotenv loaded successfully")
except ImportError:
print("❌ python-dotenv not installed")
sys.exit(1)
print("\n" + "="*50)
print("Environment Variables from .env file")
print("="*50 + "\n")
# Check Anthropic API Key
anthropic_key = os.getenv('ANTHROPIC_API_KEY')
if anthropic_key:
print(f"✅ ANTHROPIC_API_KEY: {anthropic_key[:20]}...{anthropic_key[-10:]}")
else:
print("❌ ANTHROPIC_API_KEY: Not set")
# Check Google API Key
google_api_key = os.getenv('GOOGLE_API_KEY')
if google_api_key:
print(f"✅ GOOGLE_API_KEY: {google_api_key[:20]}...{google_api_key[-10:]}")
else:
print("⚠️ GOOGLE_API_KEY: Not set (optional)")
# Check Google Credentials Path
google_creds = os.getenv('GOOGLE_APPLICATION_CREDENTIALS')
if google_creds:
if os.path.isfile(google_creds):
print(f"✅ GOOGLE_APPLICATION_CREDENTIALS: {google_creds} (file exists)")
else:
print(f"⚠️ GOOGLE_APPLICATION_CREDENTIALS: {google_creds} (file NOT found)")
else:
print("⚠️ GOOGLE_APPLICATION_CREDENTIALS: Not set (optional)")
print("\n" + "="*50)
print("Summary")
print("="*50 + "\n")
if anthropic_key:
print("✅ Configuration looks good!")
print(" - Anthropic API key is configured")
if google_api_key or (google_creds and os.path.isfile(google_creds)):
print(" - Google Cloud Vision is configured")
else:
print(" - Google Cloud Vision not configured (optional)")
else:
print("❌ Missing required configuration!")
print(" - Edit .env file and add ANTHROPIC_API_KEY")
print()