Pesarifu is an application for conducting data analysis of financial statements, primarily from mobile transactions. Current features include:
- Data Extraction from PDF Statements into SQL Tables. Supports PDFs from
- Safaricom (MPesa)
- Standard Chartered
- Equity
- Export transactions to CSV, JSON and Excel files.
- Report generation using Evidence
See examples/mpesa.pdf for an example statement and examples/Financial Report by Pesarifu for John Mwangi.pdf for an example output report produced by the application.
Additional documentation can be found in docs/.
- clone and
cdinto repo - set your own values for the variables in
.env.exampleand load it into the environmentsource .env.example - ensure the following are defined in
pesarifu.configfolder- In
settings.tomlCELERY_BROKER_URL- URL for celery broker, expects RedisCELERY_RESULTS_BACKEND- URL for celery results backend, expects Redis can be same asCELERY_BROKER_URLAPP_BASE_URL- base web URL that app is deployedSTATEMENTS_BASE_DIR- where financial statements are stored after uploadEXPORTS_BASE_DIR- where csv/excel etc exports are stored before being sent
- In
.secrets.tomlMAIL_USER- email used to send report to user.MAIL_PASSWORD- password for theMAIL_USERemailTELEGRAM_BOT_TOKEN- token for Telegram notificationsDB_URL- production and development url for accessing DB through SQLAlchemy, expects postgres e.gDB_URL = "postgresql+psycopg2://postgres:@localhost:5432/pesarifu"
- In
- run
poetry install - run
npm install - run alembic to setup the database
alembic upgrade head - cd into
reports/- run
npm install
- run
- (optional) run
python -m pesarifu.db.seedto seed the database with some example data for a report.
- Make sure
redisandpostgresare running - Use
just celery-runto start celery workers - Use
just app-runto start the web app - Use
just reports-serveto start the evidence report back-end