This repository was archived by the owner on Dec 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 13 files changed +667
-575
lines changed Expand file tree Collapse file tree 13 files changed +667
-575
lines changed Original file line number Diff line number Diff line change 1
1
TRACKER_TELEGRAM_TOKEN = sometoken
2
2
DATABASE_URL = someurl
3
+ GOOGLE_API_EMAIL = apiemail
Original file line number Diff line number Diff line change
1
+ __pycache__
2
+ /.env
3
+ /app.yaml
4
+ /accounts
5
+ /.gcloudignore
6
+ /app.log
Original file line number Diff line number Diff line change @@ -28,23 +28,29 @@ python3 main.py
28
28
```
29
29
30
30
## 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.
32
32
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.
34
34
35
- /addentry - To add new entry
35
+ /addentry - Add a new entry to your expense tracking system.
36
36
37
- /addtranports - To quickly add new transport entry
37
+ /addtransports - Quickly add a new transport entry to your expense tracker.
38
38
39
- /addothers - To quickly add others entry
39
+ /addothers - Quickly add another type of entry to your expense tracker.
40
40
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
42
44
43
45
## Planned Features
44
46
1 . More options for /addothers
45
47
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
48
54
49
55
## Contributing
50
56
File renamed without changes.
Original file line number Diff line number Diff line change 2
2
3
3
class EntryType (Enum ):
4
4
TRANSPORT = "Transport"
5
- OTHERS = "Others"
6
-
7
-
5
+ OTHERS = "Others"
Original file line number Diff line number Diff line change 1
- from firebase_config import db
2
- import datetime as dt
3
- from common import EntryType
1
+ from bot .firebase_config import db
4
2
5
3
# new user setup
6
4
def new_user_setup (telegram_id , sheet_id ):
Original file line number Diff line number Diff line change 3
3
from firebase_admin import db
4
4
import os
5
5
6
- databaseURL = os .getenv ("DATABASE_URL" )
6
+ DATABASE_URL = os .getenv ("DATABASE_URL" )
7
7
8
8
cred = credentials .Certificate ("accounts/firebase_account.json" )
9
9
firebase_admin .initialize_app (cred , {
10
- 'databaseURL' : databaseURL
11
- })
10
+ 'databaseURL' : DATABASE_URL
11
+ })
Original file line number Diff line number Diff line change 1
1
from google .oauth2 import service_account
2
2
from googleapiclient .discovery import build
3
- from common import EntryType
4
- import datetime as dt
3
+ from bot .common import EntryType
5
4
6
5
# Path to the downloaded JSON key file
7
6
SERVICE_ACCOUNT_FILE = 'accounts/service_account.json'
12
11
# Dropdown range
13
12
transport_range = ["Dropdown!A3:A9" ]
14
13
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" ]
16
15
payment_sub_range = [f"Dropdown!{ chr (i )} 12:{ chr (i )} 19" for i in range (ord ('A' ), ord ('K' ))]
17
16
payment_main_range = ["Dropdown!A12:J12" ]
18
17
Original file line number Diff line number Diff line change
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
File renamed without changes.
You can’t perform that action at this time.
0 commit comments