Skip to content

jlchafardet/unit-converter-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Storage Unit Converter Extraordinaire! 💾

Hello there, digital storage enthusiast! Welcome to the most exciting storage unit converter this side of the silicon valley! 🎉

What's This All About? 🤔

Ever found yourself drowning in a sea of bytes, kilobytes, and gigabytes? Fear not! This Python script is here to rescue you from the depths of storage unit confusion. It's like having a universal translator for your hard drive!

What Can It Do? 🎭

This magical script can convert between:

  • Storage:
    • Bytes (B)
    • Kilobytes (KB)
    • Megabytes (MB)
    • Gigabytes (GB)
    • Terabytes (TB)
    • Petabytes (PB)
  • Distance:
    • Millimeters (MM)
    • Centimeters (CM)
    • Meters (M)
    • Kilometers (KM)
    • Inches (IN)

Whether you're dealing with the tiniest byte or a colossal petabyte, or measuring distances from millimeters to kilometers, we've got you covered!

How to Use This Wizardry 🧙‍♂️

  1. Clone this repository:

    git clone https://github.com/jlchafardet/unit-converter-python.git
  2. Navigate to the project directory:

    cd unit-converter-python
  3. Run the script:

    python unit-converter.py
  4. Follow the prompts:

    • Enter the value you want to convert
    • Enter the unit you're converting from
    • Enter the unit you're converting to
  5. Voila! Watch in awe as your units are magically converted! ✨

Example 🌟

Enter the value (go wild!): 1
Enter the source unit (B, KB, MB, GB, TB, PB, MM, CM, M, KM, IN) - we don't judge: IN
Enter the target unit (B, KB, MB, GB, TB, PB, MM, CM, M, KM, IN) - the sky's the limit: CM
Abracadabra! 1.0 IN is equal to 2.54 CM

🎉 What's New? (Changes)

🌟 Version 1.1: The "Pretty Print" Update 🖨️

Hold onto your SSDs, folks! We've just pushed an update that'll make your conversions look as slick as they calculate! Here's what's new:

  • Gorgeous Output: Say goodbye to number soup! We've added thousand separators to make those big numbers easy on the eyes. 👀✨
  • Decimal Delight: We've trimmed the fat on those trailing decimals. Now you'll see a tidy 2 decimal places. Precision meets beauty!

Before (Yawn 🥱):

Abracadabra! 1234567.89 MB is equal to 1.234567890 TB

After (Wow! 😍):

Abracadabra! 1,234,567.89 MB is equal to 1.23 TB

Why did we do this? Because we believe that even bytes deserve to look their best! 💅

So go ahead, give it a spin! Your converted units are ready for their glamour shot. Who said math can't be fabulous? 🎭🚀

🌈 Version 1.2: The "Technicolor Dream Code" Update 🎨

Hold onto your pixels, because we're painting the town... err, terminal! 🖌️✨ Our latest update is here to make your conversions not just accurate, but downright dazzling!

What's new in this kaleidoscope of an update?

  • Greener Pastures: Your conversion results are now a beautiful, soothing green. It's like they're growing right before your eyes! 🌱
  • Mellow Yellow: The target unit now shines in a sunny yellow. Because why should bananas have all the fun? 🍌
  • Resetting Rainbows: We've added color resets to ensure your terminal doesn't turn into a disco ball. Party responsibly! 🕺💃

Before (Monochrome Madness 😴):

Abracadabra! 1,234,567.89 MB is equal to 1.23 TB

After (Chromatic Celebration 🎉):

Screenshot from 2024-10-21 01-00-16

Why did we do this? Because life's too short for boring terminals! Now your storage conversions are not just calculations, they're tiny digital light shows. 🌟

🌈 Version 1.3: The "Input Validation Hero" Update 🦸‍♂️

We're stepping up our input validation game! Here's what's new:

  • Negative Input Protection: No more pesky negative values ruining your conversions! We've got you covered with input validation that ensures only positive numbers are accepted.
  • Ctrl+C Cancellation: Need to cancel your conversion in a hurry? No problem! We've added support for abrupt cancellations (Ctrl+C) to exit gracefully.

Why did we do this? Because we care about your conversion experience! 💕

🌈 Version 1.4: The "Inch-perfect" Update 📏

Get ready to measure up with our latest addition: inches! We've extended our distance conversion functionality to include inches (IN). Now you can convert between inches and other units with ease.

Why did we do this? Because we believe that every unit deserves a place in the spotlight! 💫

🌈 Version 1.5: The "Help Me Help You" Update 🦮

Drumroll please! 🥁 We've just made our converter even more user-friendly with a brand new help system that actually... helps!

What's cooking in this helper-focused update?

  • Help When You Need It: Type 'help' at the main prompt and watch the magic happen! We'll show you all the available options and gently guide you back to the start. Because everyone needs a helping hand sometimes! 🤝
  • Smoother Flow: We've redesigned the program flow to make it more intuitive. No more getting stuck in conversion limbo! 🌊
  • Better Navigation: After viewing help, you'll smoothly return to the welcome message. It's like having a built-in GPS for your conversions! 🧭

Before (Confusing Times 😕):

Enter the value (go wild!): help
*confused silence*

After (Helpful Times 😊):

Type 'storage' for bytes and bits, or 'distance' for lengths and widths: help
*shows helpful information*
*returns to welcome message*

Why did we do this? Because sometimes we all need a little guidance, and what's better than a friendly helper that speaks your language? 🗣️💫

Who's Behind This Sorcery? 🧑‍💻

This script was crafted by Jose Luis Chafardet Grimaldi at a point in time where he was a little bored but wanted to keep exploring some algorithms. If you have any questions, feel free to reach out!

Contribute 🤝

Found a bug? Have an idea for an improvement? Want to add support for exabytes? Feel free to open an issue or submit a pull request. All contributions are welcome!

License 📜

This project is open source and available under the MIT License.

Final Words 📢

Remember, in the world of digital storage, size does matter! But with this converter, you'll always know exactly how much. Happy converting! 🎊

About

A simple unit converter written in python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages