Funcion-heavy and simplistic unit converter for distances, masses, temperatures and time conversions.
View Source Code »
Report Bug
·
Request Feature
Table of Contents
Annoyed with your Canadian cousins' celcius? Frustrated with your British friends refering to distances as miles that aren't "Morales"? Ever tried convert between the metric and imperial systems by hand?
Well now you don't have to. This simple script will do it for you. We've got your back, so that you can go back to the fun life with less measurement politics and less math.
There are many unit converters available on GitHub - probably more than I can count; however, this is mine. Created without guides, nor based on templates - this "bush code", albeit rudamentary and primitave, demonstrates the practicality of functions, elif and the metric system.
Unit Converter supports the following Units of Meassurement:
- Distance
- Kilometer (km)
- Meter (m)
- Centimeter (cm)
- Millimeter (mm)
- Miles (mi)
- Yards (yd)
- Inches (in)
- Mass
- Tonnes (t)
- Kilogram (kg)
- Gram (g)
- Milligram (mm)
- Pounds (lbs)
- Stone (st)
- Ounces (oz)
- Temperature
- Degrees Celcius (C)
- Kelvin (K)
- Degrees Farenheit (F)
- Degrees Rankine (R)
- Time
- Days (d)
- Hours (hr)
- Minutes (min)
- Seconds (sec)
- Speed
- Mile Per Hour (mph)
- Kilometers Per Hour (kph)
- Meters Per Second (mps)
- Knots (kt)
Setting up Unit Converter on your local machine is as simple as 1, 2, 3. Just follow the steps; 1, 2 and 3.
You'll need Python 3.8 or higher. Don't worry, it doesn't bite ... often.
How to download the lastest version of Python:
- Click here to navigate to python's official page.
- Click on the big, flashy "Download Python [version]" button.
- Save the executable file.
- Open the .exe file within the downloaded location, and follow the installation instructions.
1 Open the terminal / command prompt:
- On PC: Open Command prompt by pressing start, then typing "cmd" then hit ENTER.
- On Mac OS: Click the Launchpad icon in the Dock, type Terminal in the search field, then click Terminal.
- Navigate to the directory you would like to install Unit Converter:
cd [DirectoryPathHere]
- Clone the repository by entering the following command into your shell:
git clone https://github.com/John-JonSteyn/UnitConverter.git
It's that simple! You can run Unit converter with following command:
python unitconverter.py
When you run the script, this message will be displayed. From here we can select which dimention we would like to convert in.
To select Distance, we'll just type it out:
Distance
Now we select a unit we'd like to convert from, for example:
Meter
Next enter the value of our unit, for illustation
273
Now we have our measurement converted and returned to us in each of the units. We are also sent back to the main menu.
Mass follows the same logic, as can be seen here:
As is the case with Temperature:
And, not surprisingly, Time is no different:
Same with speed. Who would've thought: <Insert Screenshot here>
You can also quit the program at any time by typing:
Quit
- "Kilometre" changed to "Kilometer"
- Fixed Temperature-function call
- Revised system exit
- Add back to top links
- Remove Case-Sensitivity
- Improve Output Appearance
- Add option to utilise acronyms as input
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
I'd like to thank Nikolai, who not only supported me in my endevour to start loading my projects onto GitHub, but also helped fuzzing and de-bugging my first program.
I'd also like to acknowledge and recommend these resources that made the learning python even simpler than it already is.