Cashflower

Latest version: v0.10.0

Safety actively analyzes 715032 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 8

37.78.89.9

python

from cashflower import CSVReader

reader = CSVReader("data.csv")
value = float(reader.get_value("2", "C"))

24.45.56.6

11.12.23.3

6.6

0.10.0

What's new

The `run` function has been updated to return more information. It now gives back a tuple with three elements:
* `output` - the main results of the model,
* `diagnostic` - information on the model's variables,
* `log` - list of messages.

How this affects existing code

Before:

python
run.py
...

if __name__ == "__main__":
output = run(settings=settings, path=os.path.dirname(__file__))


Now:

python
run.py
...

if __name__ == "__main__":
output, diagnostic, log = run(settings=settings, path=os.path.dirname(__file__))


Required updates

In version 0.10.0 and later, unpack all three elements as shown above. Otherwise, `output` will contain the entire tuple, which could cause errors in code that expects only the model results.

Reason for the change

The updated return format provides greater flexibility. It makes it easier to access and manage diagnostic information and log messages.

0.9.6

The new version introduces support for running the model from the command line with user-defined arguments, offering greater flexibility when using the CLI.

For example, to specify a custom output filename when running the model:

bash
python run.py --filename "my-awesome-output.csv"


The argument can be captured using the `parse_arguments` function:

python
run.py
import os
from cashflower import run, parse_arguments
from settings import settings


if __name__ == "__main__":
output = run(settings=settings, path=os.path.dirname(__file__))
args, unknown = parse_arguments()
filename = unknown[1]
output.to_csv(f"{filename}")

Page 1 of 8

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.