To extract exchange rates from Bank Negara Malaysia and send the content by email.
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:
- API call to extract exchange rates from Bank Negara Malaysia OpenAPI and save in excel file.
- Excel Power Query transform the data into the required format.
- Send the content to receipients by email.
Email content screenshot for data in Nov-2021:
- Create a project folder, subfolders to store the exchange rate data and image.
- 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
- Change the Excel Power Query folder data source in the Excel working file.
- Download and run the .py file.
- Input the year and month for the data extraction.
- Done!
- To make the program run monthly automatically.
- To improve the currency selection coding as it is currently indicate by different urls (to change to different currency_code).
- To make the excel working file to be more dynamic to date selection.