A modern, high-performance resume parsing API built with FastAPI that extracts structured information from PDF resumes using advanced NLP techniques.
- Advanced PDF Processing - Supports multiple PDF parsing methods (PyPDF, pdfminer.six)
- NLP-Powered Extraction - Uses spaCy for intelligent text analysis
- Comprehensive Data Extraction:
- π§ Personal Information (name, email, phone)
- π Social Media Links (LinkedIn, GitHub)
- πΌ Skills and Technologies
- π Education Details
- πΊοΈ Location and Address Information
- π Languages
- Modern FastAPI - Built with FastAPI 0.128.0 with automatic OpenAPI documentation
- Type-Safe - Comprehensive type hints throughout
- Production-Ready - Proper error handling, logging, and validation
- Maintainable Architecture - Clear API, service, extractor, schema, and domain layers
- Docker Support - Containerized for easy deployment
- AWS Lambda Ready - Configured for serverless deployment
- Python 3.10+
- pip
-
Clone the repository
git clone https://github.com/YOUR_USERNAME/fastapi_resume_parser.git cd fastapi_resume_parser -
Create virtual environment
python3.11 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Download required NLTK data
python -c "import nltk; nltk.download('punkt_tab'); nltk.download('averaged_perceptron_tagger_eng'); nltk.download('maxent_ne_chunker_tab'); nltk.download('stopwords'); nltk.download('words')" -
Run the server
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
-
Test the API
Visit http://localhost:8000/docs for interactive API documentation
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Root endpoint - API status |
| GET | /health |
Health check endpoint |
| POST | /v1/resumes/parse |
Parse resume and extract information |
| POST | /parse |
Backward-compatible parse endpoint |
Using cURL:
curl -X POST "http://localhost:8000/v1/resumes/parse" \
-H "accept: application/json" \
-H "Content-Type: multipart/form-data" \
-F "file=@resume.pdf"Using Python:
import requests
url = "http://localhost:8000/v1/resumes/parse"
files = {"file": open("resume.pdf", "rb")}
response = requests.post(url, files=files)
print(response.json()){
"status": "success",
"filename": "resume.pdf",
"personal_info": {
"name": "John Doe",
"email": ["john.doe@example.com"],
"phone_number": "+1234567890"
},
"social_links": {
"linkedin": "linkedin.com/in/johndoe",
"github": "johndoe"
},
"skills": ["Python", "FastAPI", "Machine Learning"],
"education_details": {
"courses": ["B.Tech"],
"specializations": ["Computer Science"],
"college": ["University of Technology"]
},
"languages": ["English"],
"processing_info": {
"text_length": 1250,
"tokens_processed": 320,
"entities_found": 15
}
}fastapi_resume_parser/
βββ app/
β βββ core/
β β βββ config.py # Configuration management
β β βββ errors.py # Application-specific exceptions
β β βββ logging.py # Logging setup
β βββ api/
β β βββ dependencies.py # FastAPI dependency factories
β β βββ routes/ # HTTP route modules
β βββ domain/
β β βββ models.py # Internal parser result models
β βββ extractors/ # Focused resume field extractors
β βββ resources/ # Local parsing vocabularies
β βββ schemas/
β β βββ responses.py # Public API response models
β βββ services/ # Parser orchestration and infrastructure services
β βββ main.py # FastAPI application
βββ tests/
β βββ test_api.py # API tests
βββ requirements.txt # Production dependencies
βββ requirements-dev.txt # Development dependencies
βββ pyproject.toml # Tool configurations
βββ Dockerfile # Docker configuration
βββ README.md # This file
Run the test suite:
# Install development dependencies
pip install -r requirements-dev.txt
# Run tests
pytest
# Run tests with coverage
pytest --cov=app --cov-report=htmlThis project uses several tools to maintain code quality:
# Format code
black app/ tests/
# Sort imports
isort app/ tests/
# Lint code
flake8 app/ tests/
# Type checking
mypy app/Install pre-commit hooks to automatically check code quality:
pre-commit install# Build the image
docker build -t fastapi-resume-parser .
# Run the container
docker run -p 8000:8000 fastapi-resume-parserCreate a .env file based on .env.example:
DEBUG=false
LOG_LEVEL=info
MAX_FILE_SIZE=10485760
CORS_ORIGINS=*
ALLOW_CREDENTIALS=falseThe app is ready to deploy as a standard ASGI service with Uvicorn, as a Docker container, or behind an API gateway using the included Mangum handler.
Contributions are welcome! Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
- FastAPI - Modern web framework
- spaCy - Industrial-strength NLP
- pdfminer.six - PDF text extraction
For questions or support, please open an issue on GitHub.
Made with β€οΈ using FastAPI and Python