When Banks Get Boring, Build Your Own Converter

Day 35 of 100 Days Coding Challenge: Python

As an accountant, I sometimes find myself wrangling with currencies like the Euro or the Yen—especially when it’s time to pay international vendors. Sure, I could just hop over to a bank’s website to check the latest rate and be done with it. But where’s the fun in that? There’s something satisfying about making a mini tool that does the fetching for you. It’s like teaching your computer to do the boring part while you sip coffee and pretend you’re working very hard. Besides, who wouldn’t want their own personal exchange rate butler?

Today’s Motivation / Challenge

Today’s project was all about merging curiosity with practicality. Currency converters might not sound glamorous, but they’re surprisingly useful—and they offer the perfect excuse to explore how APIs work in the wild. Plus, if you’ve ever had to double-check if you’re about to overpay a vendor in yen, you’ll understand the thrill of watching your own Python script spit out the answer faster than your bank’s clunky interface ever could.

Purpose of the Code (Object)

This script fetches real-time exchange rates and converts any amount between two currencies. Instead of trusting your memory or the whims of Google, you can just run this quick script and let it do the math. It’s lightweight, no fuss, and runs right in your terminal.

AI Prompt:

Convert currency between any two valid codes using live data. Keep it light. No API keys, no hassle.

Functions & Features

  • Converts between any two standard currency codes (e.g., USD to JPY)
  • Fetches live exchange rates from a free public API
  • Displays the converted amount in real time
  • Includes error handling for invalid codes or bad input

Requirements / Setup

You’ll need:

pip install requests

Works with: Python 3.x

Minimal Code Sample

url = f”https://open.er-api.com/v6/latest/{from_currency.upper()}”

response = requests.get(url)

rate = response.json()[“rates”].get(to_currency.upper())

converted = amount * rate

This fetches the latest rates and calculates the converted amount.

Currency Converter

Notes / Lessons Learned

This program did not go down without a fight. There are two main ways to fetch real-time exchange rates:
Option 1 is using https://api.exchangerate.host/convert, which is free and doesn’t need an API key. It sounded perfect. I plugged in the URL, hit run, and got… nothing. After far too much debugging, I realized the problem wasn’t the code—it was that something on my system was redirecting that link to exchangeratesapi.io, a completely different API that demands an API key. DNS goblins? Old environment settings? Ghosts of APIs past? Who knows.

So, I switched to a new free option: https://open.er-api.com. No signup, no key, and it worked like a charm. The moral of the story? Sometimes the easiest-looking door is secretly locked, and the best path forward is just to find a different door. Preferably one that doesn’t ask for your email address.

Optional Ideas for Expansion

  • Add a list of common currency codes for reference
  • Let users select currencies from a simple dropdown in a GUI version
  • Track historical exchange rates for past transactions

How to Build Your First Flask Web App in Python (Hello, World!)

Day 32 of 100 Days Coding Challenge: Python

Today I met Flask—and no, not the kind you sneak whiskey into conferences with. This one is a web framework, and it’s my first real step into the world of web applications. At first glance, the code looked suspiciously simple: import Flask, create an app, slap a “Hello, World!” on the screen. That’s it? Really?

But behind that humble greeting lies a whole new realm of possibilities. I’m already plotting how to use this for my future AI projects. Imagine wrapping a Python model into a sleek web interface—Flask makes that not just possible but practically inviting. For now, I’m staying in my lane and keeping it small. One “hello world” at a time. Baby steps, but hey, even Iron Man had to build his first suit in a cave.

Today’s Motivation / Challenge

Building websites sounds like something best left to Silicon Valley wizards, but today proved it doesn’t have to be. Flask gives you a gentle nudge into the web world, perfect for anyone who’s ever wanted to turn a Python script into something users can actually interact with. No dragons to slay, just a server to run.

Purpose of the Code (Object)

This little project sets up a tiny website on your computer that proudly displays “Hello, World!” when you visit it in a browser. It’s the classic starter app, but this time, you’re doing it with your own Python magic. Think of it as shaking hands with the Internet.

AI Prompt

Make a Flask app that runs a server on localhost and displays “Hello, World!” on the homepage.

Functions & Features

  • Runs a basic web server locally
  • Displays a message (“Hello, World!”) when you open the site
  • Prepares the foundation for future web-based apps

Requirements / Setup

pip install flask

Minimal Code Sample

from flask import Flask  

app = Flask(__name__)  

@app.route(‘/’)  

def hello():  

    return ‘Hello, World!’  

This sets up a web route at / and returns a greeting when accessed.

Flaskapp

Notes / Lessons Learned

This was surprisingly fun. I’ve never built a web app before, but now I’ve got a tiny server cheering me on from my browser tab. There’s a lot more to learn—routing, templates, maybe even form handling—but I already see how this can be the launchpad for my AI work. I’ve been tinkering with Python models in isolation, but now I can give them a proper front door. The best part? I didn’t need a massive framework or a team of developers. Just me, Flask, and a mildly confused browser.

Optional Ideas for Expansion

  • Change the greeting based on the time of day
  • Add a new route, like /about, to test routing
  • Connect it to an AI model that responds with something witty (or weird)