This project began as a Google Sheets document that shows each member what they owe each month, and automatically incremented. I would manually correct the values when I was paid. I wanted to fully automate this process, and to do so, I wrote some Python code. It accesses APIs to Venmo and Google Sheets, allowing me to request payments from each member of the plan, detect when the payments have been completed, and write all relevant information back to the Google Sheets document.
In the Automation folder, my Google Apps Script (JavaScript) code is shown, which manages the values in the spreadsheet. It contains how much money each user owes, or is owed, in the form of prepayment. Likewise, the number of months owed or prepaid is shown. Using a trigger (https://script.google.com/home/triggers), the owed columns automatically increment by 1 month's worth of payment every 6th of the month, between 8 and 9 am.
This folder also contains my batch file that is run by Windows Task Scheduler. This is ran every day at 10 am, or as soon as possible after this time. It runs the python program, which updates a log and error log file. If anything special or unexpected occurs, the batch file opens the log file to show what has happened.
The APIs folder contains the functions I wrote to access necessary information through Venmo_API and GoogleClientAPI. The Venmo.py allows me to log in and out, request payments, and read all relevant requested payments. I added a function that tests that all user information matches expected values before requesting money, in case someone happens to change their username, listed name, etc. It also holds the functions (in Google_Sheets.py) needed to read and write data to the spreadsheet.
Note that the Google Sheets code accesses a file called Credentials, with a token.pickle and a credentials.json file. These are automatically generated by logging into Google client API, and are private tokens to my account. Thus, they will not be shown here. Similarly, the locally stored Constants.py file contains sensitive information, which is imported from a local file, Private_Constants.py. This stores my Venmo login information, and the usernames and Venmo IDs of the members of the plan.
Local_Files holds some examples of .txt files the program saves to my machine. Here, the log and error log file reside, as well as files and backup files of the information stored in the Google Sheets document, and any pending payment request that has not yet been paid. Note that in Member_List.txt (and the backup file), USER_ID replaces the user's actual ID, which has been hidden for security purposes. While it is not necessary to store this data in a file, it allows ease of access in creating a Member object from the file. This Member object is setup in Member.py, which helps keep track of all users this program accesses.
Daily Checkup is the Python script that is ran daily by the batch file. It completes all necessary actions for a daily check of events. If it is the 6th of the month, it runs the Monthly Update file as well, which handles payment requests, and updates everyone's balance.
Link to Spreadsheet: https://docs.google.com/spreadsheets/d/1kcdbFgniYEnsaoiGPkRPmQIR3hitxA7YbbYIR3DJg0M/edit?usp=sharing