Skip to content

A Flask-powered unit conversion web application that provides instant, accurate conversions for length, weight, and temperature measurements. Features a responsive UI, real-time calculations, and comprehensive test coverage. Perfect for developers needing a reliable conversion tool or learning Flask web development.

License

Notifications You must be signed in to change notification settings

P-Nelly/roadmap-unit-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ROADMAP-UNIT-CONVERTER

A versatile web-based unit conversion tool built with Flask that handles length, weight, and temperature conversions

license last-commit repo-top-language repo-language-count


Table of Contents


Overview

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).


Features

  • 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

Project Structure

└── roadmap-unit-converter/
    ├── LICENSE
    ├── README.md
    ├── app.py
    ├── requirements.txt
    └── templates
        ├── base.html
        ├── index.html
        ├── length.html
        ├── temperature.html
        └── weight.html

Project Index

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

Getting Started

Prerequisites

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

Installation

Install roadmap-unit-converter using the following methods:

  1. Clone the roadmap-unit-converter repository:
git clone https://github.com/P-Nelly/roadmap-unit-converter
  1. Navigate to the project directory:
cd roadmap-unit-converter
  1. Install the project dependencies:
pip install -r requirements.txt

Usage

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.

Testing

Run the test suite using the following commands:

  1. Install testing dependencies:
pip install pytest pytest-flask coverage
  1. Run tests with coverage:
coverage run -m pytest tests/
coverage report
  1. 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

Project Roadmap

  • 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

Contributing

Contributing Guidelines
  1. Fork the Repository: Start by forking the project repository to your github account.
  2. Clone Locally: Clone the forked repository to your local machine using a git client.
    git clone https://github.com/P-Nelly/roadmap-unit-converter
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.
    git checkout -b new-feature-x
  4. Make Your Changes: Develop and test your changes locally.
  5. Commit Your Changes: Commit with a clear message describing your updates.
    git commit -m 'Implemented new feature x.'
  6. Push to github: Push the changes to your forked repository.
    git push origin new-feature-x
  7. Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
  8. Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
Contributor Graph


License

This project is protected under the MIT License. For more details, refer to the LICENSE file.


Acknowledgments


About

A Flask-powered unit conversion web application that provides instant, accurate conversions for length, weight, and temperature measurements. Features a responsive UI, real-time calculations, and comprehensive test coverage. Perfect for developers needing a reliable conversion tool or learning Flask web development.

Topics

Resources

License

Stars

Watchers

Forks