adision de bases para trabajo completo de back-v1.0.0
This commit is contained in:
24
test_csv_extractor.py
Normal file
24
test_csv_extractor.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# test_csv_extractor.py
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
# Añadir el directorio raíz al path
|
||||
sys.path.append(str(Path(__file__).parent))
|
||||
|
||||
from app.helpers.extractCsv import CSVExtractor
|
||||
|
||||
# Prueba con un CSV público
|
||||
test_url = "https://people.sc.fsu.edu/~jburkardt/data/csv/hw_200.csv"
|
||||
|
||||
try:
|
||||
print("📥 Descargando CSV...")
|
||||
content = CSVExtractor.download_csv(test_url)
|
||||
print(f"✅ Descargado: {len(content)} caracteres")
|
||||
|
||||
print("📖 Leyendo CSV...")
|
||||
rows = CSVExtractor.read_csv(content)
|
||||
print(f"✅ Leídas {len(rows)} filas")
|
||||
print(f"📋 Columnas: {list(rows[0].keys()) if rows else 'Ninguna'}")
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ Error: {e}")
|
||||
Reference in New Issue
Block a user