Skip to content

API call to extract exchange rates from Bank Negara Malaysia, refresh excel data and send its content by email.

License

Notifications You must be signed in to change notification settings

changhong-choo/bnm-exchange-rate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

To extract exchange rates from Bank Negara Malaysia and send the content by email.

Description

This project is aim to automate the process of extracting monthly closing exchange rates from Bank Negara Malaysia and send the report to receipients by email. This project covers SGD, THB, PHP, GBP, USD, AUD, and IDR, you can adjust to fit your needs.
The overall process is as follow:

  1. API call to extract exchange rates from Bank Negara Malaysia OpenAPI and save in excel file.
  2. Excel Power Query transform the data into the required format.
  3. Send the content to receipients by email.

Email content screenshot for data in Nov-2021:

Steps to complete before run the program

  1. Create a project folder, subfolders to store the exchange rate data and image.
  2. Input the necessary value for the following variables in the python file
  • urls (optional) -> to include/remove the currency needed
  • file_path -> path to save the exchange rate data
  • excel_path -> file_path + excel_name + excel_type (xlsx)
  • image_path -> path + image_name + image_type (png)
  • sheet_name -> excel sheet name
  • copy_range -> excel data range to be copy
  • sender -> sender's email
  • sender_pw -> sender's email password
  • receivers -> one or more receivers email
  1. Change the Excel Power Query folder data source in the Excel working file.

Execute the program

  1. Download and run the .py file.
  2. Input the year and month for the data extraction.
  3. Done!

Further improvement

  1. To make the program run monthly automatically.
  2. To improve the currency selection coding as it is currently indicate by different urls (to change to different currency_code).
  3. To make the excel working file to be more dynamic to date selection.

About

API call to extract exchange rates from Bank Negara Malaysia, refresh excel data and send its content by email.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages