System Requirements
Before installing the Electronic Invoice Processing API, ensure your system meets these requirements:Python Version
Python 3.9 or higher required
Disk Space
Minimum 200 MB for dependencies
RAM
At least 512 MB available memory
Operating System
Linux, macOS, or Windows
Installation Methods
- pip (Recommended)
- Docker
- Manual Installation
Using pip and Virtual Environment
Create Virtual Environment
Creating a virtual environment is recommended to isolate dependencies:
You should see
(venv) or (invoice-api) in your terminal prompt after activation.Install Dependencies
Install all required packages from requirements.txt:This will install the following packages:
View All Dependencies
View All Dependencies
- fastapi==0.100.0 - Modern web framework for building APIs
- pandas==2.0.3 - Data manipulation and Excel file processing
- openpyxl==3.1.2 - Excel file format support (.xlsx)
- python-multipart==0.0.6 - File upload support for FastAPI
- num2words==0.5.11 - Convert numbers to words in Spanish
- uvicorn==0.23.2 - ASGI server for running FastAPI
- numpy==1.25.2 - Numerical computing library (pandas dependency)
Environment Configuration
The API uses FastAPI’s built-in configuration. Key settings are defined in the main application:CORS Configuration
The API is configured with CORS middleware to allow cross-origin requests:main.py:16-22
Server Configuration
You can customize the server settings when starting Uvicorn:Verification Steps
After installation, verify that the API is working correctly:Check API Health
Start the server and visit the interactive documentation:Open your browser to:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
Test the Endpoint
Verify the You should see the FastAPI documentation page.
/process_excel endpoint is available:Troubleshooting
ImportError: No module named 'fastapi'
ImportError: No module named 'fastapi'
This means FastAPI is not installed. Ensure you’ve activated your virtual environment and run:
Port 8000 is already in use
Port 8000 is already in use
Another process is using port 8000. Either stop that process or use a different port:
Excel file processing fails
Excel file processing fails
Ensure your Excel file:
- Contains all required columns
- Has the correct column names (case-sensitive)
- Contains valid data types (dates as dates, numbers as numbers)
- Is in .xlsx format (not .xls)
Docker container won't start
Docker container won't start
Check the container logs:Common issues:
- Port conflict (change port mapping:
-p 8001:8000) - Missing files (ensure all files are copied correctly)
- Permission issues (check file permissions)
Next Steps
Quickstart Guide
Learn how to process your first invoice in under 5 minutes
API Reference
Explore detailed API endpoint documentation
Excel Format
Learn about required Excel columns and data formats
Invoice Structure
Understand the electronic invoice JSON output format
Understanding the Dependencies
Core Framework
- FastAPI: Modern, high-performance web framework for building APIs with automatic documentation
- Uvicorn: Lightning-fast ASGI server implementation
Data Processing
- pandas: Powerful data manipulation library for reading and processing Excel files
- openpyxl: Engine for reading Excel 2010+ (.xlsx) files
- numpy: Fundamental package for numerical operations (pandas dependency)
Utilities
- python-multipart: Handles multipart form data for file uploads
- num2words: Converts numeric amounts to Spanish words for invoice text fields (main.py:36-71)
The
num2words library is specifically configured for Spanish (lang='es') to comply with Venezuelan electronic invoice requirements.