Data processing pipeline for financial analysis of invoices and expenses from Fakturoid API.
API client configurations for downloading data from Fakturoid API.
Bruno/Fakturoid API/- Bruno API client collection with requests for invoices and expensesInvoices Index.bru- Request to fetch invoicesExpenses Index.bru- Request to fetch expensesObtain Access Token.bru- OAuth token requestout_data/- Saved API respones
Postman/- Postman collection (alternative to Bruno)
Data files organized by processing stage.
01_Source/- Raw JSON data downloaded from Fakturoid APIInvoices.json- Invoice dataExpenses.json- Expense data
02_Source CSV/- CSV files converted from JSON source data- Main tables:
Invoices.csv,Expenses.csv - Related tables:
*_lines.csv,*_payments.csv,*_vat_rates_summary.csv
- Main tables:
03_Transformed Data/- Final transformed data for analysisMovements_clean.csv- Unified movements table (invoices + expenses)Movements_clean_documentation.md- Complete data model documentation
Data processing scripts organized by workflow step.
01_download/- Instructions for downloading data from Fakturoid API02_json_to_csv/- JSON to CSV conversion scriptjson_to_csv.py- Main conversion script with nested fields supportprocess_source_data.sh- Batch processing script
03_data_transformations/- SQL scripts for data transformation01_create_table_movements.sql- Create unified Movements table02_insert_invoices.sql- Insert invoice data03_insert_expenses.sql- Insert expense data04_transform_data.sql- Create Movements_clean table
End-to-end test suite for the JSON to CSV converter.
json_to_csv/- Test cases forjson_to_csv.pytest1/throughtest8/- Individual test scenariosrun_all_tests.sh- Run complete test suite- Each test includes input JSON, expected output, and comparison script
Project assignment materials and documentation.
MBI-Data_Analyst_Engineer-Case study - Varianta_A (1).pdf- Case study assignmentAPI columns.md- API column reference documentationtodo.md- Project task list
- Python 3.13
uvpackage manager (seepyproject.tomlanduv.lock)- SQL database (for data transformations)
- Bruno or Postman (for API data download)
- Download - Fetch invoices and expenses from Fakturoid API (since 2021-01-01)
- Convert - Transform JSON to CSV format using
json_to_csv.py - Transform - Execute SQL scripts to create unified
Movements_cleantable - Analyze - Use
Movements_clean.csvfor financial reporting
- User Guide:
Report Guidline.pdf- Guidelines for creating financial reports - Data Model:
Data/03_Transformed Data/Movements_clean_documentation.md- Complete schema and field descriptions
Run end-to-end tests for JSON to CSV conversion:
./tests/json_to_csv/run_all_tests.shIndividual tests can be run from their respective directories.