System Requirements
Python Version
Python 3.8 or higher
Package Manager
pip (comes with Python)
Memory
Minimum 2GB RAM
Storage
500MB free disk space
Installation Steps
Install Dependencies
Install all required Python packages:This installs the following key packages:
| Package | Version | Purpose |
|---|---|---|
| fastapi | 0.115.12 | Web framework for building the API |
| uvicorn | 0.34.2 | ASGI server for running FastAPI |
| pydantic | 2.11.4 | Data validation and settings |
| ortools | 9.12.4544 | Google’s optimization library for scheduling |
| pandas | 2.2.3 | Data manipulation and analysis |
| numpy | 2.2.6 | Numerical computing |
| requests | 2.32.3 | HTTP library for making API calls |
| pytest | 8.3.5 | Testing framework |
Verify Installation
Check that all packages are installed correctly:You should see all the packages from requirements.txt listed.
Set Up Data Files
The system requires JSON data files in the
data/ directory. Ensure these files exist:Sample data files are included in the repository. See the Data Structure section below for details on the format.
Data Structure
The system uses JSON files to store catalog data. Here’s the structure of each file:Asignaturas (Courses)
Contains course information and requirements:data/asignaturas.json
teorica: Theoretical courses (require standard classrooms)laboratorio: Lab courses (require computer labs or specialized equipment)hibrida: Hybrid courses (can use either type of classroom)
Aulas (Classrooms)
Contains classroom specifications:data/aulas.json
teorica: Standard classroom for lectureslaboratorio: Computer lab or specialized labhibrida: Multi-purpose room
Recursos (Resources)
Available resources that classrooms can have:data/recursos.json
Docentes (Teachers)
Teacher information:data/docentes.json
Sedes (Campus/Buildings)
Campus or building information:data/sedes.json
Programaciones (Reservations)
This file stores classroom reservations and is managed by the API:data/programaciones.json
reservado: Classroom is reserved but not yet confirmedocupado: Classroom is confirmed and in usecancelado: Reservation was cancelled
Configuration
FastAPI Application Settings
The main application configuration is insrc/main.py:
src/main.py
Server Configuration
You can configure the server with command-line options:Verify Installation
Run these commands to ensure everything is set up correctly:Running Tests
The project includes a test suite using pytest:Development Tools
Interactive API Documentation
FastAPI provides automatic interactive documentation:Swagger UI
Interactive API testing interfaceVisit:
http://localhost:8000/docsReDoc
Alternative API documentationVisit:
http://localhost:8000/redocHot Reload
When running with--reload, the server automatically restarts when you modify Python files. This is perfect for development but should be disabled in production.
Troubleshooting
Python version error
Python version error
If you see a Python version error, ensure you’re using Python 3.8 or higher:On some systems, you may need to use
python3 instead of python.pip install fails
pip install fails
If package installation fails:
- Upgrade pip:
pip install --upgrade pip - Try installing packages individually to identify the problematic package
- Check your Python version compatibility
Data files not found
Data files not found
Ensure the
data/ directory exists and contains all required JSON files. The API looks for data files relative to the src/ directory:Port already in use
Port already in use
If port 8000 is occupied:
CORS errors in browser
CORS errors in browser
If you encounter CORS errors when calling the API from a web application:
- Verify the CORS middleware is configured in
src/main.py - Check that your origin is allowed in the
allow_originslist - Ensure cookies/credentials are properly configured if using authentication
Import errors
Import errors
If you see
ModuleNotFoundError:- Ensure you’re in the project root directory
- Verify all dependencies are installed:
pip list - Check that your virtual environment is activated
- Try reinstalling requirements:
pip install -r requirements.txt --force-reinstall
Next Steps
Quick Start
Make your first API call in 5 minutes
API Reference
Explore all available endpoints
Guides
Learn how to use the API effectively
Architecture
Understand the system design patterns