Skip to content
This repository was archived by the owner on Dec 23, 2023. It is now read-only.

Commit 73942cd

Browse files
committed
update 1.1.0
1 parent 1eeeb1e commit 73942cd

File tree

13 files changed

+667
-575
lines changed

13 files changed

+667
-575
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
TRACKER_TELEGRAM_TOKEN=sometoken
22
DATABASE_URL=someurl
3+
GOOGLE_API_EMAIL=apiemail

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
__pycache__
2+
/.env
3+
/app.yaml
4+
/accounts
5+
/.gcloudignore
6+
/app.log

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,29 @@ python3 main.py
2828
```
2929

3030
## Usage
31-
/start - Start bot and configure your google sheet
31+
/start - Start the bot and configure your Google Sheet for tracking expenses and other entries.
3232

33-
/config - To update your google sheet, or configure quick settings for /addtransports and /addothers
33+
/config - Update your Google Sheet settings or configure quick settings for adding transport and other entries.
3434

35-
/addentry - To add new entry
35+
/addentry - Add a new entry to your expense tracking system.
3636

37-
/addtranports - To quickly add new transport entry
37+
/addtransports - Quickly add a new transport entry to your expense tracker.
3838

39-
/addothers - To quickly add others entry
39+
/addothers - Quickly add another type of entry to your expense tracker.
4040

41-
/cancel - To cancel previous conversation with bot
41+
/cancel - Cancel the previous conversation with the bot and start fresh.
42+
43+
/help - Show help message
4244

4345
## Planned Features
4446
1. More options for /addothers
4547
2. Retrieve your last few transaction
46-
4. Use webhook instead of polling
47-
5. Host onto serverless function
48+
3. /addincome
49+
4. Recurring transaction
50+
5. Budgeting notification
51+
6. Reminders
52+
7. Use webhook instead of polling
53+
8. Host onto serverless function
4854

4955
## Contributing
5056

File renamed without changes.

common.py renamed to bot/common.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22

33
class EntryType(Enum):
44
TRANSPORT = "Transport"
5-
OTHERS = "Others"
6-
7-
5+
OTHERS = "Others"

firebase.py renamed to bot/firebase.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
from firebase_config import db
2-
import datetime as dt
3-
from common import EntryType
1+
from bot.firebase_config import db
42

53
# new user setup
64
def new_user_setup(telegram_id, sheet_id):

firebase_config.py renamed to bot/firebase_config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
from firebase_admin import db
44
import os
55

6-
databaseURL = os.getenv("DATABASE_URL")
6+
DATABASE_URL = os.getenv("DATABASE_URL")
77

88
cred = credentials.Certificate("accounts/firebase_account.json")
99
firebase_admin.initialize_app(cred, {
10-
'databaseURL': databaseURL
11-
})
10+
'databaseURL': DATABASE_URL
11+
})

google_sheet.py renamed to bot/google_sheet.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from google.oauth2 import service_account
22
from googleapiclient.discovery import build
3-
from common import EntryType
4-
import datetime as dt
3+
from bot.common import EntryType
54

65
# Path to the downloaded JSON key file
76
SERVICE_ACCOUNT_FILE = 'accounts/service_account.json'
@@ -12,7 +11,7 @@
1211
# Dropdown range
1312
transport_range = ["Dropdown!A3:A9"]
1413
others_sub_range = [f"Dropdown!{chr(i)}2:{chr(i)}9" for i in range(ord('B'), ord('K'))]
15-
others_main_range = ["Dropdown!A2:J2"]
14+
others_main_range = ["Dropdown!B2:J2"]
1615
payment_sub_range = [f"Dropdown!{chr(i)}12:{chr(i)}19" for i in range(ord('A'), ord('K'))]
1716
payment_main_range = ["Dropdown!A12:J12"]
1817

bot/logger.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import logging
2+
3+
def setup_logger():
4+
# Create a logger instance
5+
logger = logging.getLogger(__name__)
6+
logger.setLevel(logging.WARNING)
7+
8+
# Create a file handler
9+
file_handler = logging.FileHandler('app.log', mode='a')
10+
file_handler.setLevel(logging.WARNING)
11+
12+
# Create a formatter
13+
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
14+
15+
# Set the formatter for the handlers
16+
file_handler.setFormatter(formatter)
17+
18+
# Add the handlers to the logger
19+
logger.addHandler(file_handler)
20+
return logger

sql_db.py renamed to bot/sql_db.py

File renamed without changes.

0 commit comments

Comments
 (0)