Skip to content

πŸ’° This project is an attempt to propose a better understanding of individual portfolio πŸ’Έ.

Notifications You must be signed in to change notification settings

Manfred-Madelaine-pro/py-accounting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

73 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›οΈ Accounting

Aim is to propose a simple algorithm that read, parse, store, process and display financial data for individuals πŸ’Έ.

πŸŽ‰ Examples

Example in old version (Click to expand)

running main script

πŸ—“οΈ Dates

πŸš€ Version 2 Started

Project pitched and started the 11th december 2020

🎯 Release date

  • First expected release the friday 15th december 2020
  • Second expected release the 10th january 2021

πŸ”Œ Dependencies

  1. πŸ–₯️ Set your Virtual Environment:

    # Download venv librairy
    apt-get install python3-venv -y
    # Create your venv
    python3 -m venv venv
    # Activate your venv
    . venv/bin/activate

    For more information, go to Python Virtual Environment Official Documentation.

  2. πŸ“¦ Install the project dependencies:

    apt install python3-pip
    pip install PTable
    pip install Flask
    
    pip install PyPDF2

⚑ Quick start

  1. Database configuration:

    	mkdir -p back/database/ && touch back/database/accounting.db
    	mkdir -p data/sg/ 
    	# create the input directory for file integration
  2. To start the backend server, simply run bellow commands:

    	export FLASK_APP=controller.py
    	export FLASK_ENV=development
    	flask run
    	# * Running on http://127.0.0.1:5000/

🎨 Architecture

Version 2

Accounting Architecture

Version 1 (Click to expand)

Accounting Architecture

πŸ“‹ Tasks

  1. Database

    • Create schema
    • Try to use some DB framework
    • Fix the duplicate issue
  2. Payments

    • Create account
    • Fake few payments
    • Compute few metrics
  3. REST API

    • Expose data

      • Flask
      • GraphQL ~> not very effective
    • Design API (Postman ~> not effective)

    • Insert payments ?

    • Expose metrics

  4. Integration

    • CSV from Societe Generale
      • Get all files in directory
      • read each file, one after the other
      • Parser rows and map to RawPayments
    • Save in database
      • Generic object's management in database
      • If file is duplicate => skip
    • View all payments and duplications between files (count same lines in file and across files)
    • CSV from N26
    • 4% of the database (72/1685 payments) is corrupted by duplicated values from different files
  5. Statistics

    • Low level stats
      • Total credit/debit for quantity and amount
      • Min, Max, Avg, opening, closing
    • Handle consumption periods (~daily, weekly, monthly)
      • Add periodicity: Trimester, Semester
    • Metrics column info
      • Add header info line for metrics column
      • Add footer avg line for metrics column
    • Identify FIXED income and expenses (try to rely on LABELS)
    • Define profile
    • string similarity calculation to identify recurrent transactions
  6. Filter v2

    • Allow labeling (Add, remove, reset)
    • Auto labeling on token
      • Available labels: transport, rent, salary, phone, AMZ, SG, Healthcare...
    • Filter payments on account & list of labels
    • Ensure payments uniqueness
    • Group some labels together (expose groups to client ?)
    • Filter payments on account & group
    • Percentage of payments (qty & amount) labeled (or group) for a given period
    • Pie chart for example
    Filter v1 (Click to expand)
    1. Labels
      • Tag all payments

      • Define groups based on tags

      • Create groups that matches perfectly one tag, multiple tags or other groups

      • Apply metrics on groups

      • Allow enforced new tag for payment id

      • Count payments in groups

      • Count payments untagged

      • Identify overlapping tags

      • Auto labeling on rules

      • Endpoint for labeling

      • Create categories and pattern that fall in this category

        • Courses
        • Amazon
      • Can 2 categories share same payments ?

        • Need exclusive categories for global expenses pie-chart
        • and non-exclusive
  7. Integrate PDFs

    • Download all PDFs available from banking platforms
    • Read Parse (PyPDF2, tabula)
    • Extract data ~> not very effective
    • Store raw payments
  8. Architecture

    • Design first diagram of internal services
      • Try coding schema
    • Add the schema to README
    • Define API specification using Swagger
  9. Front

    • Consumption map on a calendar just like github contribution calendar
    • Display payments curve

πŸ•ΉοΈ More examples

πŸ’Ύ Database example

Database example

About

πŸ’° This project is an attempt to propose a better understanding of individual portfolio πŸ’Έ.

Resources

Stars

Watchers

Forks