Coverage for src/sankey_cashflow/__init__.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v7.15.0, created at 2026-07-05 04:36 +0000

1""" 

2sankey-cash: transforms columnar transaction data (CSV or Google Sheets) into cashflow graph 

3data, and renders it as a Sankey diagram or a line chart via plotly. 

4 

5See README.md for usage instructions and examples. 

6 

7References: 

8- https://lifewithdata.com/2022/08/29/how-to-create-a-sankey-diagram-in-plotly-python/ 

9- https://erikrood.com/Posts/py_gsheets.html 

10- https://github.com/nithinmurali/pygsheets 

11- https://pygsheets.readthedocs.io/en/stable/ 

12- https://plotly.com/python/sankey-diagram/ 

13 

14Notes: 

15- Permissions: Create a service account and download credentials in json format 

16 (detailed instructions here: https://pygsheets.readthedocs.io/en/stable/authorization.html), 

17 then share the spreadsheet with the service account user. 

18""" 

19 

20from .cli import main 

21from .data_row import DataRow 

22from .diagram import build_line_figure, build_sankey_figure 

23from .io import fetch_data, read_csv_as_df, read_gsheet_as_df 

24from .labels import RowLabels 

25from .settings import AppSettings 

26from .transactions import Transactions 

27from .utils import ( 

28 df_date_filter, 

29 is_empty, 

30 is_null, 

31 normalize_amounts, 

32 save_report, 

33 validate_date_string, 

34) 

35 

36__all__ = [ 

37 "AppSettings", 

38 "RowLabels", 

39 "Transactions", 

40 "DataRow", 

41 "fetch_data", 

42 "read_csv_as_df", 

43 "read_gsheet_as_df", 

44 "build_sankey_figure", 

45 "build_line_figure", 

46 "main", 

47 "is_null", 

48 "is_empty", 

49 "df_date_filter", 

50 "save_report", 

51 "validate_date_string", 

52 "normalize_amounts", 

53]