diff options
author | xengineering <me@xengineering.eu> | 2024-09-08 12:56:05 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2024-09-08 17:21:32 +0200 |
commit | 8bfe0176a00b11b09365925eb57e383d024a63ec (patch) | |
tree | fe333d9da8fbc5ba399fc3391adf3c434c739f22 /demo | |
parent | 7521277860b377e3e9ec7b6d5a62c4c2c14d694f (diff) | |
download | finance-py-8bfe0176a00b11b09365925eb57e383d024a63ec.tar finance-py-8bfe0176a00b11b09365925eb57e383d024a63ec.tar.zst finance-py-8bfe0176a00b11b09365925eb57e383d024a63ec.zip |
Rename demo -> demo.py
This makes sure this script is also detected by the tools used in
tools/check_source.sh.
In general it is not a bad idea to use a file name extension to indicate
the file type. This improves compatibility with other tools in general.
The downside is that command line tools usually should not have a file
name extension. This can be worked around by using symlinks or an
install step. Both can remove the file name extension.
Diffstat (limited to 'demo')
-rwxr-xr-x | demo | 47 |
1 files changed, 0 insertions, 47 deletions
@@ -1,47 +0,0 @@ -#!/usr/bin/python3 - - -import argparse - -from datetime import datetime -from decimal import Decimal - -from finance.flow import Flow, simulate -from finance.visualize import display - - -DESCRIPTION = "Demo application plotting financial data with finance-py" - - -def main() -> None: - argparse.ArgumentParser(description=DESCRIPTION).parse_args() - - measured = [ - (datetime(2024, 1, 1), Decimal(105.0)), - (datetime(2024, 2, 1), Decimal(207.0)), - (datetime(2024, 3, 1), Decimal(334.0)), - ] - - 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), - ), - ) - - simulated = simulate( - start=datetime(2024, 1, 1), - end=datetime(2030, 1, 1), - flows=flows, - ) - - display( - simulated=simulated, - measured=measured, - ) - - -if __name__ == "__main__": - main() |