Giter Club home page Giter Club logo

mydollarbot's Introduction

💸 TrackMyDollar


Expense tracking made easy!


MIT license GitHub GitHub contributors DOI Platform codecov GitHub issues GitHub closed issues Actions Status github workflow


About TrackMyDollar

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.


Table of contents

⭐ Whats New

Version 1.0.2

New Features:

  • 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.

Version 1.0.1

New Features:

  • 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

For Contributors:

  • 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.

Version 1.0.0

New Features:

  • 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

For Contributors:

  • 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.

🚀 Installation Guide

😃For users

No setup required! Try our production bot here: https://t.me/mydollarbotprod_bot

💻For developers

  1. Install Python, atleast Python3

  2. Clone this repository to your local system at a suitable directory/location of your choice

  3. Start a terminal session, and navigate to the directory where the repo has been cloned

  4. Run the following command to install the required dependencies:

  pip install -r requirements.txt
  1. Download and install the Telegram desktop application for your system from the following site: https://desktop.telegram.org/

  2. Once you login to your Telegram account, search for "BotFather" in Telegram. Click on "Start" --> enter the following command:

  /newbot
  1. 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)

  2. BotFather will now confirm the creation of your bot and provide a TOKEN to access the HTTP API - copy this token for future use.

  3. 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"
  1. 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.

  1. A successful run will generate a message on your terminal that says "TeleBot: Started polling."
  2. 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

💁 Samples

Budget

I want to increase/decrease my monthly budget.

  1. Enter the /budget command
  2. Enter the new budget amount (must be greater than 0)

Add

I just spent money and want to mark it as a transaction!

  1. Enter the /add command
  2. Click on the date of the transaction
  3. Click on the category to add
  4. Type in the amount spent

Delete

Oh no! I entered a transaction but want to delete it!

  1. Enter the /delete command
  2. Based on how many records you want to delete..
    1. Per day: enter the day to delete
    2. Per month: enter the month to delete
    3. All: enter All
  3. The records will be display. Enter YES to confirm, or NO to cancel

Edit

Oh no! I entered a transaction but entered the wrong category!

  1. Enter the /edit command
  2. Specify the date, category, and value of the transaction
  3. Specify what part of the transaction to edit (either date, category, or value)
  4. Enter in a new value

Adding transactions from CSV and displaying chart

I want to add transactions from a CSV my bank gave me, and visalize my spendings

  1. Drag the .csv file into the telegram chat, and press send
  2. For each transaction, classify the category
    1. The application will remember these mappings
  3. Enter the /chart command

❔ Documentation

Thorough documentation of all methods and classes can be found at Github Pages

🚧 Road Map

Our ideas for new features that can be implemented to make this project better can be seen in our RoadMap project board. Road Map

🙋 Team Members

Version 1.0.0

  • Ashley King
  • Manoj Kumar
  • Rakesh Muppala
  • Sayali Parab
  • Ashwin Das
  • Renji Joseph Sabu

Version 1.0

Team Members

  • Dev
  • Prakruthi
  • Radhika
  • Rohan
  • Sunidhi

📲 Support

For any support, email us at [email protected]

mydollarbot's People

Contributors

ashwindasr avatar deekay2310 avatar kingan1 avatar mtkumar123 avatar prakruthisomashekar avatar radhikaraman20 avatar rakeshavm avatar renjiniravath avatar rohansinha96 avatar snparab1704 avatar sunidhihegde avatar

mydollarbot's Issues

Improve delete functionality

Currently, the delete keyword deletes all history without getting user confirmation

  1. Require user confirmation
  2. Display records that will be deleted
  3. Add an option to select one record to be deleted

For step 3, change code to have these options:
Delete all history or selective records?

  1. All (if all selected, display everything and require confirmation)
  2. One (if one selected, ask to select everything in past day, or month. Then display records to be deleted)

BUG: delete command

Running the delete command causes a crash

get_number_of_transactions is incorrect

Update the readme

Updated the readme, with all the new features added, and then changed the contributors to reflect the current team working on the project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.