TrackMyDollar is an easy-to-use Telegram Bot that assists you in recording your daily expenses on a local system without any hassle.
With simple commands, this bot allows you to:
- Add/Record a new spending
- Show the sum of your expenditure for the current day/month
- Display your spending history
- Clear/Erase all your records
- Edit/Change any spending details if you wish to
Check out the bot here: https://t.me/mydollarbotprod_bot
A demo is shown below. It is run on a local machine.
- A calendar functionality was added so the user can specify what day a transaction was added.
- The user can now add custom categories instead of using the default categories.
- The bot server is now hosted on heroku, so users do not have to run the python file locally. Check out production bot here: https://t.me/mydollarbotprod_bot
- Visualizations can be seen using the chart command, which generates a pie chart based on user spending.
- More thorough documentation can be found on the GitHub pages.
- Users are now able to upload a csv file containing transactions with columns “Date”, “Description”, “Debit”, and “Date. The bot will go through each transaction in the csv file, and for transactions it has already seen before, the bot will automatically classify that transaction into the right category. For transactions, that the bot has not seen before, the bot will request the user to choose the appropriate category for that transaction.
- Consistent input and output format for all date values, and numeric values of transactions
- Test cases have been completely written. Test cases in the bot folder are tests for functions in the bot.py, while test cases in the unit folder are for the user.py.
- Updated the documentation for all functions.
- Updated Readme.md to reflect current team working on this project.
- Users are now able to set a budget expenditure for each category. If users exceed the budget for that category, a message it displayed reminding the user of the budget they had initially set.
- Users are now able to delete their entire transaction history, or choose to delete just one transaction
- Code has been refactored, and split into two main python files. Bot.py handles all the bot processing functions, and interacts with the bot handler directly. User.py handles all the backend User processing logic, and creates an object User for each individual user interacting with the bot, to maintain that user’s state.
- Data is stored within the user object, and state is saved using a pickle object.
- Created CI pipeline using Travis CI, and pylint to check for formatting errors, and code coverage to test for code coverage.
No setup required! Try our production bot here: https://t.me/mydollarbotprod_bot
-
Install Python, atleast Python3
-
Clone this repository to your local system at a suitable directory/location of your choice
-
Start a terminal session, and navigate to the directory where the repo has been cloned
-
Run the following command to install the required dependencies:
pip install -r requirements.txt
-
Download and install the Telegram desktop application for your system from the following site: https://desktop.telegram.org/
-
Once you login to your Telegram account, search for "BotFather" in Telegram. Click on "Start" --> enter the following command:
/newbot
-
Follow the instructions on screen and choose a name for your bot. Post this, select a username for your bot that ends with "bot" (as per the instructions on your Telegram screen)
-
BotFather will now confirm the creation of your bot and provide a TOKEN to access the HTTP API - copy this token for future use.
-
In the directory where this repo has been cloned, navigate to the "code" folder and open the "code.py" file. This file consists of a variable by the name "api_token". Paste the token copied in step 8 in the placeholder provided for this variable:
api_token = "INSERT API KEY HERE"
- In the Telegram app, search for your newly created bot by entering the username and open the same. Once this is done, go back to the terminal session. Navigate to the directory containing the "code.py" file and run the following command:
python code/bot.py
If you get the error ModuleNotFoundError: No module named 'code.user'; 'code' is not a package
, add the absolute path to the main project folder to python path export PYTHONPATH="${PYTHONPATH}:/path/to/your/project/"
and try again. (You'll have to re-add if you close the terminal or add to the environment variables.)
You can also change the code from code.user import User
to from user import User
on line 16 of bot.py. The former is for pylint compatablity.
- A successful run will generate a message on your terminal that says "TeleBot: Started polling."
- Post this, navigate to your bot on Telegram, enter the "/start" or "/menu" command, and you are all set to track your expenses!
For more info on deployment(Heroku), check out the doc here
I want to increase/decrease my monthly budget.
- Enter the
/budget
command - Enter the new budget amount (must be greater than 0)
I just spent money and want to mark it as a transaction!
- Enter the
/add
command - Click on the date of the transaction
- Click on the category to add
- Type in the amount spent
Oh no! I entered a transaction but want to delete it!
- Enter the
/delete
command - Based on how many records you want to delete..
- Per day: enter the day to delete
- Per month: enter the month to delete
- All: enter All
- The records will be display. Enter YES to confirm, or NO to cancel
Oh no! I entered a transaction but entered the wrong category!
- Enter the
/edit
command - Specify the date, category, and value of the transaction
- Specify what part of the transaction to edit (either date, category, or value)
- Enter in a new value
I want to add transactions from a CSV my bank gave me, and visalize my spendings
- Drag the .csv file into the telegram chat, and press send
- For each transaction, classify the category
- The application will remember these mappings
- Enter the
/chart
command
Thorough documentation of all methods and classes can be found at Github Pages
Our ideas for new features that can be implemented to make this project better can be seen in our RoadMap project board. Road Map
- Ashley King
- Manoj Kumar
- Rakesh Muppala
- Sayali Parab
- Ashwin Das
- Renji Joseph Sabu
- Dev
- Prakruthi
- Radhika
- Rohan
- Sunidhi
For any support, email us at mydollarbot@gmail.com