A comprehensive collection of web-based tools and utilities built with FastAPI and Python.
-
PDF Tools
- Combine multiple PDF files into one
- Compress PDFs while maintaining readability
-
Image Tools
- Resize images with optional aspect ratio preservation
- Convert between different image formats (JPEG, PNG, WEBP)
- Optimize images to reduce file size
-
Unit Converter
- Length (km, m, cm, mm, mi, yd, ft, in)
- Area (km², m², cm², ha, ac, ft²)
- Volume (m³, L, mL, gal, qt, pt, fl oz)
- Weight (kg, g, mg, lb, oz)
- Temperature (Celsius, Fahrenheit, Kelvin)
- Clone the repository:
git clone https://github.com/yourusername/web-utils.git
cd web-utils
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
Start the FastAPI server:
uvicorn app.main:app --reload
The application will be available at:
- Web Interface: http://127.0.0.1:8000
- API Documentation: http://127.0.0.1:8000/docs
GET /pdf
- PDF tools interfacePOST /pdf/combine
- Combine multiple PDFsPOST /pdf/compress
- Compress a PDF file
GET /image
- Image tools interfacePOST /image/resize
- Resize an imagePOST /image/convert
- Convert image formatPOST /image/optimize
- Optimize image size
GET /units
- Unit converter interfaceGET /units/api/convert
- Convert between units- Parameters:
type
: Type of conversion (length, area, volume, weight, temperature)from_unit
: Source unitto_unit
: Target unitvalue
: Value to convert
- Parameters:
GET /privacy
- Privacy Policy
- FastAPI - Modern Python web framework
- Jinja2 - Template engine
- PyPDF2 - PDF processing
- Pillow - Image processing
- Pydantic - Data validation
The project structure follows FastAPI best practices:
web-utils/
├── app/
│ ├── main.py # FastAPI application
│ ├── config.py # Configuration
│ ├── routes/ # Route handlers
│ │ ├── pdf.py
│ │ ├── image.py
│ │ ├── units.py
│ │ └── privacy.py
│ ├── static/ # Static files
│ └── templates/ # Jinja2 templates
├── requirements.txt # Python dependencies
└── README.md
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.