Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dhurtado714-itesm/expense-tracker-lambdas
https://github.com/dhurtado714-itesm/expense-tracker-lambdas
api aws-lambda notion python serverless-framework
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dhurtado714-itesm/expense-tracker-lambdas
- Owner: DHurtado714-itesm
- Created: 2024-10-28T09:45:24.000Z (9 days ago)
- Default Branch: main
- Last Pushed: 2024-10-28T09:47:49.000Z (9 days ago)
- Last Synced: 2024-10-28T14:06:58.370Z (9 days ago)
- Topics: api, aws-lambda, notion, python, serverless-framework
- Language: Python
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 📈 Exchange Rate Tracker Lambda Project
This project tracks exchange rates and updates expense and income databases in Notion using AWS Lambda functions, triggered on daily and bi-weekly schedules via the Serverless framework.
## 📝 Project Overview
The **Exchange Rate Tracker** Lambda functions fetch the latest exchange rates and update values in the specified Notion databases. The project uses `Python 3.9`, `AWS Lambda`, `Serverless Framework`, and integrates with the Notion API to update values automatically.
## 🚀 Features
- 🕒 **Automated Updates**: Tracks and updates expense and income databases on scheduled intervals.
- 💹 **Real-Time Exchange Rates**: Fetches up-to-date exchange rates to calculate currency equivalencies.
- 💻 **Serverless Deployment**: Easily deploy, update, and manage AWS Lambda functions with the Serverless framework.
- 📒 **Notion Integration**: Writes calculated values directly to your Notion databases.## 📦 Installation
1. **Clone the repository**:
```bash
git clone https://github.com/yourusername/exchange-rate-tracker
cd exchange-rate-tracker
```2. **Set up virtual environment and dependencies**:
```bash
python3.9 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
```3. **Configure AWS Credentials**:
Ensure you have the necessary AWS credentials and Notion API token.
## ⚙️ Configuration
1. **Set up Notion Secrets**:
Update your `.env` file with your Notion API token and Database IDs:
```env
NOTION_TOKEN=your_notion_token
NOTION_DB_ID_EXPENSES=your_expenses_db_id
NOTION_DB_ID_INCOMES=your_incomes_db_id
```2. **AWS Lambda Permissions**:
Ensure your AWS IAM Role has permissions for Lambda, CloudWatch, and Serverless deployments.
## 🚀 Deployment
1. **Deploy with Serverless**:
```bash
sls deploy
```2. **Invoke Locally**:
Test each function locally with:
```bash
sls invoke local -f updateExpense
sls invoke local -f updateIncome
```## 🛠️ Usage
This project includes two Lambda functions:
- **updateExpense**: Updates the Notion expense database daily with current exchange rates.
- **updateIncome**: Updates the Notion income database every 15 days with current exchange rates.## 📆 Scheduling
The functions are scheduled as follows:
- **Expenses**: Every day.
- **Incomes**: Every day.## 💡 Troubleshooting
- If encountering `No module named 'requests'`, be sure to deploy dependencies packaged with your function.
- For **Python version errors**, verify that Python 3.9 is in your PATH and configured in Serverless.## 🖊️ Notes
Remember to keep your AWS and Notion credentials secure and rotate them regularly.
---
Enjoy using the **Exchange Rate Tracker** and making currency updates effortless! 😊