Skip to content

Convert from XUA to USD #13

Description

@LaunaG

Background

Historical monthly exchange rates for AFDB's unit of account, XUA, are hosted on the bank's website here as an unordered, paginated list of links to Excel and/or PDF files:

  • The rates appear to date back to February 2004, even though the oldest AFDB project was effective in 1967.

  • PDF files are available for the whole time period whereas Excel files exist only for recent years.

  • At a quick glance, the PDF files look like they range from two to three pages in length.

Using these posted rates to convert the most recent AFDB project commitments from XUA to USD would benefit DeBIT's end users as no currency conversion is currently being performed for the bank's projects.

Acceptance Criteria

  • A Cloud Storage bucket exists to hold all exchange rate PDF files, as well as parsed outputs.

  • A Cloud Run Job crawls the site and scrapes all links to exchange rate PDF files. It lists the contents of the bucket, downloads any files that do not yet exist in the bucket to memory, and then uploads them to the bucket (e.g., exchange_rates/xua/input/august_2025_exchange_rates_0.pdf).

  • A second Cloud Run Job calls an LLM (Gemini?) to extract the exchange rate and append it to a CSV file in the bucket (exchange_rates/xua/output/rates.csv).

  • The data cleaning Cloud Run Job fetches the file from Cloud Storage, calculates the rates' yearly average, and then uses those averages to convert between XUA and USD from 2019 through the present.

  • Calls to the two new jobs have been to the data cleaning Cloud Workflow and precede any cleaning tasks.

  • Pulumi is used to deploy all new resources.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions