Logo Lanfrica

Adh-ir/FXtest

Domain:

digital infrastructure

Record type:

software
Creator:
Adh
Host:
A Python-based automation tool designed to extract 365-day historical exchange rate datasets for audit and compliance. Features built-in API throttling, support for exotic African currency pairs (ZAR, BWP, MWK), and standardized Excel export. # Forex Rate Extractor A Python-based Streamlit application to extract and audit historical foreign exchange rates using the Twelve Data API. 🌐 **Live App**: fxtest.streamlit.app ## Features ### πŸ“Š Rate Extraction * **Historical Data**: Fetches exchange rates for requested currency pairs and date ranges. * **Cross-Rate Calculation**: Automatically calculates cross-rates (e.g., ZAR β†’ BWP) via USD. * **Export Options**: Download results as CSV or Excel. ### πŸ” Audit & Reconciliation * **Rate Validation**: Upload your own rates file and compare against official Twelve Data API rates. * **Flexible Schema**: Supports various column naming conventions (Date, Base, Source, Rate). * **Variance Detection**: Marks rates as PASS or EXCEPTION based on configurable threshold. * **Testing Mode**: Use mock data to test without consuming API credits. * **Smart Rate Limiting**: Respects Twelve Data's free tier limits (8 req/min). ## Quick Start ### Access via Streamlit Cloud (Recommended) Visit fxtest.streamlit.app β€” no installation required! ### Running Locally ```bash # Clone the repository git clone github.com cd FXtest # Create virtual environment python -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate # Install dependencies pip install -r requirements.txt # Run the app streamlit run src/forex/main.py ``` ### Running with Docker ```bash docker-compose up --build ``` **Default URL**: `localhost` ## Project Structure ``` FXtest/ β”œβ”€β”€ src/forex/ # Main Python Package β”‚ β”œβ”€β”€ main.py # App entry point (Auth, Nav, Page Config) β”‚ β”œβ”€β”€ facade.py # High-level API for rate fetching β”‚ β”œβ”€β”€ auditor.py # Audit & reconciliation module β”‚ β”œβ”€β”€ api_client.py # Twelve Data API client with rate limiting β”‚ β”œβ”€β”€ data_processor.py # Data transformation & cross-rate calculation β”‚ β”œβ”€β”€ cache.py …