/payme

Just a simple repo to calculate how much to request from people after a night out

Primary LanguagePython

Open in Streamlit

Table of Contents

  1. Description
  2. Screenshots
    1. Delivery App Mode
    2. Manual Mode
    3. What Happened
    4. Output
    5. Venmo Preview
  3. How-Tos
    1. Run
    2. Host
  4. Outline
    1. Code Structure
    2. Databases

PayMe

Just a simple repo to calculate how much to request from people after a night out

Screenshots

Delivery App Mode (default)

Manual Mode

What Happened

Output

Venmo Preview

How tos

Run

  1. Clone the repository:
git clone https://github.com/pomkos/payme
cd payme
  1. Create a conda environment (optional):
conda create --name "pay_env"
  1. Activate environment, install python, install dependencies.
conda activate pay_env
conda install python=3.8
pip install -r requirements.txt
  1. Start the application:
streamlit run payme.py
  1. Access the application at localhost:8501

Host

sudo chmod +x install.sh
sudo chmod +x start_me.sh

./install.sh

Installer script will:

  1. Create new environment
  2. Install all required python libraries
  3. Add a cronjob to cron (if user desires, can be done post installation as well)
  4. Start the payme script on port 8501

Outline

Code

The codebase is organized as such:

payme
  |-- apps
      |-- calculator.py     # called by all scripts for the actual calculations
      |-- db_tool.py        # includes helper class to connect to sqlite db and extract currency info
      |-- doordash.py       # specific to doordash receipts, extracts all info
      |-- food_select.py    # used by the complex receipt receiver and the claim your meal pages
      |-- manual_mode.py    # used by default view of payme, using user provided info
      |-- ubereats.py       # specific to ubereats receipts, extracts all info
  |-- data
      |-- currency.db       # stores currency, country, rate info
      |-- food.db           # stores complex receipt info so users can select foods
      |-- names.db          # stores names, variations of names, and mispellings to automatically parse these from all inputs
  |-- images
  |-- .gitignore
  |-- README.md
  |-- payme.py              # the brains behind it all, redirects user provided information to the appropriate scripts in apps folder
  |-- requirements.txt

Databases

Food.db

receipt table

Stores information from the complex receipt receiver on payme

item price amount name people date
Buck to the Future (1.0 bought) 14.0 1.0 Roosevelt Room_05-21 Peter, Matt, Steve, Julie, Aron, Kyle 2021-05-21

food table

Stores information from the claim your meal section on payme. This is what is shown when users click "see everyone's claimed meals"

name food price amount total_item_price label
Peter [dessert] medovik cake (1.0 bought) 8.00 1.0 8.00 Russia House_05-02

Currency.db

country_currency table

country currency code
United Kingdom Pound Sterling GBP

currency_rates table

rate country currency code date_updated
0.729266 United Kingdom Pound Sterling GBP 2021-03-25

Names.db

names table

Just a database of names with different spellings, for easier parsing of info

names
bl@ise