1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#!/usr/bin/python3
import argparse
from datetime import datetime
from decimal import Decimal
from finance.flow import Flow, simulate, display
DESCRIPTION = "Demo application plotting financial data with finance-py"
def main() -> None:
argparse.ArgumentParser(description=DESCRIPTION).parse_args()
flows = (
Flow(amount=Decimal(100.0), since=None, until=None),
Flow(
amount=Decimal(200.0),
since=datetime(2026, 1, 1),
until=datetime(2027, 1, 1),
),
)
data = simulate(
start=datetime(2024, 1, 1),
end=datetime(2030, 1, 1),
flows=flows,
)
display(data)
if __name__ == "__main__":
main()
|