guion-analyzer / setup_project.py
Malaji71's picture
Upload setup_project.py
2b8f964 verified
import os
import json
def create_project_structure():
"""Crea la estructura completa del proyecto Series Analyzer Pro"""
# Estructura de carpetas
folders = [
"core",
"parsers",
"analyzers",
"analyzers/structural",
"analyzers/character",
"analyzers/production",
"analyzers/quality",
"models",
"templates",
"templates/prompts",
"templates/industry_formats",
"data",
"outputs",
"outputs/reports",
"outputs/visualizations",
"cache",
"utils",
"tests",
"tests/test_data"
]
# Crear carpetas
for folder in folders:
os.makedirs(folder, exist_ok=True)
# Crear __init__.py en cada carpeta Python
if not folder.startswith(("outputs", "cache", "data", "templates")):
init_path = os.path.join(folder, "__init__.py")
if not os.path.exists(init_path):
with open(init_path, 'w') as f:
f.write('"""Module for {}"""\n'.format(folder.replace("/", ".")))
# Crear config.yaml básico
config_content = """# Series Analyzer Pro Configuration
app:
name: "Series Analyzer Pro"
version: "1.0.0"
debug: true
analysis:
max_pages_per_episode: 60
min_pages_per_episode: 40
default_episode_count: 6
parser:
supported_formats: ["fdx", "pdf"]
encoding: "utf-8"
output:
reports_format: ["pdf", "html", "json"]
visualization_format: "png"
cache:
enabled: true
ttl_hours: 24
"""
with open("config.yaml", 'w') as f:
f.write(config_content)
# Crear requirements.txt actualizado
requirements = """# Series Analyzer Pro Requirements
# Core
gradio==4.44.0
torch>=2.0.0
transformers>=4.35.0
accelerate>=0.24.0
spaces>=0.18.0
sentencepiece>=0.1.99
protobuf<4
numpy<2.0
pyyaml>=6.0
# Parsing
lxml>=4.9.0
beautifulsoup4>=4.12.0
python-docx>=0.8.11
# Analysis
pandas>=2.0.0
matplotlib>=3.7.0
seaborn>=0.12.0
plotly>=5.14.0
networkx>=3.1
# NLP
spacy>=3.5.0
textstat>=0.7.3
# Scraping
requests>=2.31.0
selenium>=4.10.0
scrapy>=2.9.0
# Export
reportlab>=4.0.0
openpyxl>=3.1.0
python-pptx>=0.6.21
# Utils
tqdm>=4.65.0
python-dotenv>=1.0.0
"""
with open("requirements.txt", 'w') as f:
f.write(requirements)
print("✅ Estructura del proyecto creada exitosamente!")
print("\n📁 Carpetas creadas:")
for folder in folders:
print(f" - {folder}/")
print("\n📄 Archivos creados:")
print(" - config.yaml")
print(" - requirements.txt")
if __name__ == "__main__":
create_project_structure()