How marinoslabrakis/sap-data-extractor-analytics-dashboard works
This is a SAP procure-to-pay extraction and analytics platform. Its main workflow fetches purchase orders and invoices from SAP, normalizes invoice data, persists records and an audit entry, then computes analytics for reports and the dashboard. Scheduled jobs trigger extraction and reporting; additional capabilities include anomaly detection and optional natural-language queries. The graph combines excerpted call relationships with capabilities and architecture explicitly documented in the README; unsampled implementations are represented only where their paths are listed in the tree.
Main entry points: extraction_service.py Extraction service · reporting_service.py Reporting service · container.py DI container · analytics_service.py Analytics service
Components 25
SAP Integration
- Settings
src/core/config.py - DI container
src/core/container.py - OData client
src/extractors/odata_client.py - RFC client
src/extractors/rfc_client.py - Mock SAP client
src/extractors/mock_client.py
Data Pipeline
- P2P DTOs
src/schemas - Extraction service
src/services/extraction_service.py - Invoice normalization
src/transformers/normalize.py - Purchase-order repository
src/repositories/purchase_order_repo.py - Invoice repository
src/repositories/invoice_repo.py - Audit repository
src/repositories/audit_repo.py
Analytics & AI
- Analytics service
src/services/analytics_service.py - Data enrichment
src/transformers/enrich.py - Anomaly detection
src/ai/anomaly.py - Natural-language queries
src/ai/nlq_assistant.py
Reports & Access
- Analytics dashboard
src/dashboard/app.py - Reporting service
src/services/reporting_service.py - Excel report
src/reports/excel_report.py - PDF report
src/reports/pdf_report.py - Report email
src/reports/emailer.py - Scheduled jobs
src/scheduler/jobs.py - Pipeline command
scripts/run_pipeline.py
Other components
- Finance user
- SAP S/4HANA
- PostgreSQL
Connections 30
- DI container → Settings: loads settings
src/core/container.py - DI container → OData client: selects client
src/core/container.py - DI container → RFC client: selects client
src/core/container.py - DI container → Mock SAP client: selects client
src/core/container.py - OData client → SAP S/4HANA: fetches via OData
README.md - RFC client → SAP S/4HANA: fetches via RFC
README.md - Mock SAP client → P2P DTOs: creates DTOs
src/extractors/mock_client.py - OData client → P2P DTOs: creates DTOs
src/extractors/odata_client.py - RFC client → P2P DTOs: creates DTOs
src/extractors/rfc_client.py - Extraction service → DI container: builds clients
src/services/extraction_service.py - Extraction service → Invoice normalization: normalizes invoices
src/services/extraction_service.py - Extraction service → Purchase-order repository: upserts orders
src/services/extraction_service.py - Extraction service → Invoice repository: upserts invoices
src/services/extraction_service.py - Extraction service → Audit repository: records run
src/services/extraction_service.py - Purchase-order repository → PostgreSQL: writes orders
README.md - Invoice repository → PostgreSQL: writes invoices
README.md - Audit repository → PostgreSQL: writes audit log
README.md - Analytics service → Data enrichment: uses enrichment
src/services/analytics_service.py - Analytics dashboard → Analytics service: requests KPIs
src/dashboard/app.py - Analytics dashboard → Anomaly detection: uses detection
src/dashboard/app.py - Reporting service → Analytics service: gets metrics
src/services/reporting_service.py - Reporting service → Excel report: builds workbook
src/services/reporting_service.py - Reporting service → PDF report: builds PDF
src/services/reporting_service.py - Reporting service → Report email: sends attachments
src/services/reporting_service.py - Scheduled jobs → Extraction service: runs pipeline
src/scheduler/jobs.py - Scheduled jobs → Reporting service: runs reports
src/scheduler/jobs.py - Pipeline command → Extraction service: runs pipeline
scripts/run_pipeline.py - Pipeline command → Reporting service: runs reports
scripts/run_pipeline.py - Finance user → Analytics dashboard: views analytics
README.md - Natural-language queries → Analytics service: queries data