-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquickstart.py
More file actions
88 lines (77 loc) · 2.36 KB
/
quickstart.py
File metadata and controls
88 lines (77 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/usr/bin/env python
"""
ETL Pipeline Quick Start Script
Verifies installation and provides startup instructions
"""
import subprocess
import sys
import time
def run_tests():
"""Run quick verification tests"""
print("=" * 80)
print("✅ ETL PIPELINE - QUICK START VERIFICATION")
print("=" * 80)
print()
# Test 1: Import check
print("1️⃣ Testing imports...")
try:
import fastapi
import sqlmodel
import playwright
import pydantic
import loguru
import asyncpg
print(" ✅ All core packages imported successfully")
except ImportError as e:
print(f" ❌ Import error: {e}")
return False
print()
# Test 2: Check if Docker is available
print("2️⃣ Checking Docker...")
try:
result = subprocess.run(
["docker-compose", "ps"],
capture_output=True,
timeout=5,
cwd=r"C:\Users\LAYBA\Codes\Python-Based-Full-Stack-Data-Collection-and-Data-Pipeline-Processing-System"
)
if result.returncode == 0:
print(" ✅ Docker Compose available")
else:
print(" ⚠️ Docker Compose may need attention")
except Exception as e:
print(f" ⚠️ Could not check Docker: {e}")
print()
# Test 3: Show API endpoints
print("3️⃣ Available API Endpoints:")
endpoints = [
("GET", "/health", "Health check"),
("POST", "/scrape", "Scrape a URL"),
("GET", "/items", "Get all items"),
("GET", "/items/{id}", "Get item by ID"),
("GET", "/docs", "Interactive API docs"),
]
for method, path, desc in endpoints:
print(f" {method:6} {path:20} - {desc}")
print()
print("=" * 80)
print("🚀 NEXT STEPS")
print("=" * 80)
print()
print("1. Verify PostgreSQL is running:")
print(" docker-compose ps")
print()
print("2. Start the FastAPI application:")
print(" .venv\\Scripts\\uvicorn app.main:app --reload")
print()
print("3. Visit API documentation:")
print(" http://localhost:8000/docs")
print()
print("4. Test health endpoint:")
print(" curl http://localhost:8000/health")
print()
print("=" * 80)
return True
if __name__ == "__main__":
success = run_tests()
sys.exit(0 if success else 1)