A versatile web-based unit conversion tool built with Flask that handles length, weight, and temperature conversions
- Overview
- Features
- Project Structure
- Getting Started
- Project Roadmap
- Contributing
- License
- Acknowledgments
A Flask-based web application that provides an intuitive interface for converting between different units of measurement. The application supports conversions for length (e.g., meters to feet), weight (e.g., kilograms to pounds), and temperature (e.g., Celsius to Fahrenheit).
- Length Conversion: Convert between millimeters, centimeters, meters, kilometers, inches, feet, yards, and miles
- Weight Conversion: Convert between milligrams, grams, kilograms, ounces, and pounds
- Temperature Conversion: Convert between Celsius, Fahrenheit, and Kelvin
- User-Friendly Interface: Clean and responsive design with easy-to-use forms
- Real-Time Conversion: Instant results displayed after submission
- Mobile-Responsive: Works seamlessly on both desktop and mobile devices
└── roadmap-unit-converter/
├── LICENSE
├── README.md
├── app.py
├── requirements.txt
└── templates
├── base.html
├── index.html
├── length.html
├── temperature.html
└── weight.html
ROADMAP-UNIT-CONVERTER/
__root__
app.py Main Flask application file containing conversion logic and route handlers requirements.txt Project dependencies including Flask 2.3.3 and Werkzeug 2.3.7
templates
base.html Base template with common layout and styling index.html Homepage with conversion type selection length.html Length conversion form template temperature.html Temperature conversion form template weight.html Weight conversion form template
Before getting started with roadmap-unit-converter, ensure your runtime environment meets the following requirements:
- Python: Version 3.6 or higher
- Package Manager: Pip
- Web Browser: Any modern web browser
Install roadmap-unit-converter using the following methods:
- Clone the roadmap-unit-converter repository:
git clone https://github.com/P-Nelly/roadmap-unit-converter
- Navigate to the project directory:
cd roadmap-unit-converter
- Install the project dependencies:
pip install -r requirements.txt
Run roadmap-unit-converter using the following command:
Using flask
flask run
# or
python -m flask run
The application will start and be available at http://127.0.0.1:5000/
in your web browser.
Run the test suite using the following commands:
- Install testing dependencies:
pip install pytest pytest-flask coverage
- Run tests with coverage:
coverage run -m pytest tests/
coverage report
- Run individual test categories:
# Run length conversion tests
pytest tests/test_length.py
# Run weight conversion tests
pytest tests/test_weight.py
# Run temperature conversion tests
pytest tests/test_temperature.py
The test suite includes:
- Unit tests for conversion functions
- Integration tests for Flask routes
- Input validation tests
- Edge case handling
-
Core Conversion Features
: Implement basic unit conversion functionality- Length conversion (mm, cm, m, km, inch, foot, yard, mile)
- Weight conversion (mg, g, kg, ounce, pound)
- Temperature conversion (Celsius, Fahrenheit, Kelvin)
-
User Interface
: Create responsive web interface- Base template with consistent styling
- Navigation menu
- Conversion forms with input validation
- Real-time result display
-
Enhanced Features
: Add additional functionality- Add more unit types (volume, area, speed, etc.)
- Implement automatic unit detection
- Add conversion history
- Enable bulk conversions
-
Technical Improvements
: Enhance code quality and user experience- Add comprehensive test suite
- Implement error handling and input validation
- Add API endpoints for programmatic access
- Optimize performance for large-scale conversions
-
Documentation & Deployment
: Improve project documentation- Add API documentation
- Include usage examples
- Create deployment guide
- Add contributing guidelines
- 💬 Join the Discussions: Share your insights, provide feedback, or ask questions.
- 🐛 Report Issues: Submit bugs found or log feature requests for the
roadmap-unit-converter
project. - 💡 Submit Pull Requests: Review open PRs, and submit your own PRs.
Contributing Guidelines
- Fork the Repository: Start by forking the project repository to your github account.
- Clone Locally: Clone the forked repository to your local machine using a git client.
git clone https://github.com/P-Nelly/roadmap-unit-converter
- Create a New Branch: Always work on a new branch, giving it a descriptive name.
git checkout -b new-feature-x
- Make Your Changes: Develop and test your changes locally.
- Commit Your Changes: Commit with a clear message describing your updates.
git commit -m 'Implemented new feature x.'
- Push to github: Push the changes to your forked repository.
git push origin new-feature-x
- Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
- Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
This project is protected under the MIT License. For more details, refer to the LICENSE file.
- Made as a Roadmap.sh project: https://roadmap.sh/projects/unit-converter
- If you like the project, please visit and give a thumbs up at: https://roadmap.sh/projects/unit-converter/solutions?u=6755306aecc889bb0d36cf17