Skip to content

Data integration

Bank ETL

Extracted bank market caps from an archived source and standardized them across four currencies for SQL and spreadsheet analysis.

  • Python
  • pandas
  • SQLite
  • 10 banks in the output
  • 4 currencies
How it works
  1. ExtractArchived bank rankings table
  2. ConvertLocal exchange rates for GBP, EUR, and INR
  3. PublishCSV and SQLite outputs

Problem and source

A market-cap ranking in USD is difficult to reuse in a report that uses another currency. I extracted the bank names and USD values from a September 8, 2023 Internet Archive snapshot of Wikipedia’s list of largest banks.

Transformation

Beautiful Soup locates the HTML table and strips surrounding whitespace. pandas casts USD market caps to floats. The transform multiplies the values by GBP, EUR, and INR rates from a checked-in CSV and rounds each result to two decimal places. The archive URL timestamps the ranking snapshot. The rates file records currencies and values, with no rate date or provider.

Data model and result

The CSV export and the SQLite table Largest_Banks contain one row per bank with its name and four market-cap columns in billions. The same table supports a quick comparison across banks or an aggregate in the report currency. The script also writes a timestamped log of the ETL stages.

What I would change next

Add a table-structure check, unique bank-name check, finite positive rates, and reconciliation between the CSV and SQLite outputs. A versioned FX table with rate dates and source attribution would make comparisons across snapshots reproducible.