Currency Converter
Phase 1 — Rate source & normalization
- Fetch daily official FX from BNR (RSS/XML) and parse safely
- Normalize to an internal map
{currency: RON_per_unit}and store the fetch timestamp - Persist a tiny local cache (e.g., JSON) to reuse the latest successful rates
Functional result: After one fetch, rates exist locally (including RON) with a timestamp; re-running can load from cache if no network.
Phase 2 — Conversion engine
- Implement the conversion function using RON as the pivot
- Support all currencies published by BNR plus RON; round outputs to 4 decimals
- Guard against missing currencies and zero/negative amounts
Functional result: Given an amount and two currencies, the function returns a correct numeric result using the latest rates.
Phase 3 — GUI (Tkinter)
- Main window with: amount entry, “From” and “To” dropdowns, “Convert” button, result label
- Include a “Refresh rates” button; Display “Last update:
” - Keep UI responsive while fetching
Functional result: User selects amount/currencies, clicks Convert, and sees an accurate result; Refresh updates rates and the timestamp without freezing the UI.
Phase 4 — Auto-update & minimal errors
- Auto-fetch on startup and once/day (or on app open if cache is older than 24h)
- Minimal errors only: if network fails, fall back to cached rates with a clear banner; reject non-numeric amounts politely
Functional result: With internet, the app auto-updates and converts; offline, it uses cached rates and still converts, warning the user about stale data.