How masbug/etoro-edavki works
Project type and purpose
• This is a single-module, command-line Python tool (etoro_edavki.py) packaged via setup.py.
• Purpose: ingest an Excel account-statement from eToro, fetch FX rates, transform and export XML forms (Doh-KDVP, D-IFI, Doh-Div) plus debug XLSX files for import into Slovenia’s eDavki system.
File structure
• Top‐level files:
• etoro_edavki.py – main CLI script + core logic
• requirements.txt – Python dependencies
• setup.py – package entry point
• Company_info.xlsx (named in README as Naslovi_info.xlsx): manual lookup of issuer info
• LICENSE, README.md, .gitignore, plus an optional Excel template
• No separate “src” or “lib” folders: all logic in one module.
• No web UI or services beyond an HTTP call to Banka Slovenije for FX rates.
Extract insights from the README
• Dependencies (likely pandas or openpyxl, requests, lxml or similar).
• Workflow:
1. CLI parses arguments (argparse or click).
2. Load eToro XLSX.
3. Fetch FX table from Banka Slovenije.
4. Convert each transaction: group by form type.
5. Generate XML files and two debug XLSX files in output/.
6. User imports XML into eDavki and completes missing fields (e.g., issuer info).
Key components
a. Main Components
• CLI Entrypoint (etoro-edavki)
• Excel Parser (reads eToroAccountStatement)
• FX Rate Fetcher (calls Banka SI API)
• Data Processor / Mapper (classifies transactions per form)
• XML Generator (creates Doh-KDVP.xml, D-IFI.xml, Doh-Div.xml)
• Debug Excel Generator (Dividende-info, Debug)
• Configuration/Manual Data (Company_info.xlsx)
• Output Folder (/output)
b. Relationships & Data Flows
• User invokes CLI → CLI Entrypoint
• CLI → Excel Parser (reads XLSX)
• CLI → FX Rate Fetcher → returns rate table
• Parser + Rates → Data Processor → splits by form type
• Data Processor → XML Generator → writes XML files to output/
• Data Processor → Debug Excel Generator → writes debug XLSX to output/
• XMLs / XLSX → imported by user into eDavki
c. Architectural Patterns & Principles
• Single-responsibility: separate parsing, rate fetching, processing, and output generation
• Modular design within one script (could be refactored into distinct modules)
• External dependency isolation (HTTP calls and file I/O)
d. Key Technologies & Libraries
• Python 3.x
• argparse or click for CLI
• pandas / openpyxl for Excel I/O
• requests for HTTP
• lxml or built-in xml.etree for XML serialization
Detail level
• Step of the CLI pipeline
• External dependencies (HTTP API, manual Excel)
• Don’t overcomplicate: you’re documenting a linear ETL-like workflow