https://github.com/rgglez/fc-exchange-rate-update
Event handler function for Aliyun FC. Fetches data from the Exchange Rate API and uploads it to an Aliyun OSS bucket.
https://github.com/rgglez/fc-exchange-rate-update
alibabacloud aliyun cronjob exchangeratesapi faas python3
Last synced: 2 months ago
JSON representation
Event handler function for Aliyun FC. Fetches data from the Exchange Rate API and uploads it to an Aliyun OSS bucket.
- Host: GitHub
- URL: https://github.com/rgglez/fc-exchange-rate-update
- Owner: rgglez
- License: mit
- Created: 2023-01-27T23:59:09.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-21T17:42:44.000Z (6 months ago)
- Last Synced: 2025-01-28T01:44:30.556Z (4 months ago)
- Topics: alibabacloud, aliyun, cronjob, exchangeratesapi, faas, python3
- Language: Python
- Homepage:
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fc-exchange-rate-update
[](https://opensource.org/licenses/BSD-3-Clause)


This is a simple Aliyun Function Compute (FC) written in Python which fetches the data in JSON format from the [Exchange Rate API](https://www.exchangerate-api.com/) (go there to get a free key) and uploads it to an Aliyun OSS bucket. It is intended to be used in a [custom container](https://www.alibabacloud.com/help/en/function-compute/latest/create-a-function)-sourced function [triggered by a timer](https://www.alibabacloud.com/help/en/function-compute/latest/configure-a-time-trigger), but you can adapt it depeding on your needs.
## Notes
* The *config.py* file is not provided, as you may already have your own configuration file/system (perhaps even using the enviroment variables of the FC). Just replace the config.config dictionary members with your own cofiguration parameters.
* A sample *Dockerfile* in provided, which you might adjust to your use case.
* A sample *requirements.txt* file is provided, which you might adjust to your use case.
* The free API has certain quota, so setup the "cronjob" to be run every hour.
* Aliyun refers to Alibaba Cloud Services, but this code can be easily adapted to run in AWS Lambda, for instance.
* I am **not** affiliated in any way to Exchange-Rate-API. I found their API handy for some of my projects. You should check if their service suits your use case, both technically and legally. Also, I'm not responsible for the quality or fitness of their service. Use it at your own risk ;)## License
Copyright (c) 2023, Rodolfo González González.
Read the LICENSE file.