A CLI tool for generating macroeconomic reports from CSV data files.
pip install -r requirements.txtpython main.py --files dataset1.csv dataset2.csv --report average-gdp| Report name | Description |
|---|---|
average-gdp |
Average GDP per country, sorted descending |
continent-gdp-share |
Cumulative GDP across all years and its percentage share |
- Create a new file in
reports/, e.g.reports/ucontinent_gdp.py - Implement a function with signature
def continent_gdp_share_report(rows: list[dict]) -> str - Register it in
reports/__init__.py:
from reports.continent_gdp import continent_gdp_share_report
REPORTS: dict = {
...
"continent-gdp-share": continent_gdp_share_report,
}That's it — the new report is automatically available via --report continent-gdp-share.
pytest