From 8bf63bc6bb62f2cc2d52ae7e09424c308ff08362 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 8 Sep 2024 11:09:43 +0200 Subject: Add demo script --- demo | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 demo diff --git a/demo b/demo new file mode 100755 index 0000000..737c312 --- /dev/null +++ b/demo @@ -0,0 +1,32 @@ +#!/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), + ) + + data = simulate( + start=datetime(2024, 1, 1), + end=datetime(2030, 1, 1), + flows=flows, + ) + + display(data) + + +if __name__ == "__main__": + main() -- cgit v1.2.3-70-g09d2