Package overview#

The repository of the cashflower package follows this structure:

.
├── .github/
│   └── workflows/
│       ├── deploy.yml
│       └── pytest.yml
├── cashflower/
│   ├── model_tpl/           # Template for the cash flow model's structure (for users)
│   ├── __init__.py
│   ├── cashflow.py          # Main logic for cash flow models
│   ├── error.py             # Custom error definitions
│   ├── graph.py             # Dependency graph creation
│   ├── reader.py            # CSV file reader class
│   ├── start.py             # Entry point and model initialization
│   └── utils.py             # Utility functions
├── dev_models/              # Fully-functioning models for development checks
├── docs/                    # Documentation files
├── tests/                   # Unit tests
├── tutorials/               # Tutorials and guides
├── .gitignore               # Ignored files for version control
├── .readthedocs.yaml        # Configuration for ReadTheDocs platform
├── LICENSE                  # License information
├── MANIFEST.in              # Specifies non-python files for packaging
├── pyproject.toml           # Configuration settings for build system and tools
├── README.md                # Main repository README
├── requirements.txt         # Required Python packages for developers
└── setup.py                 # Main setup file for package building

In this section, we’ll briefly describe the purpose of each file and folder.


Source files#

The cashflower folder contains the core package source code. Here are the key files:

  • core.py - contains the main logic for cash flow models,

  • error.py - defines custom error class,

  • graph.py - handles dependency graph creation for model variables and calculation order,

  • reader.py - provides a class for reading CSV files,

  • start.py - serves as the entry point for the package, initializing components and creating Model instances,

  • utils.py - contains utility functions.


Supporting files#

Supporting files are categorized into testing, documentation, and configuration:

Testing:

  • tests - contains unit tests,

  • dev_models - fully-functioning models for development checks.

Documentation:

  • docs - stores documentation files,

  • README.md - the main README file displayed on the repository’s main page.

Configuration:

  • setup.py - the primary setup file for building the package,

  • pyproject.toml - configuration settings for build systems and tools,

  • .github/workflows - contains GitHub workflows that are automatically triggered,

  • .gitignore - lists files to be ignored by version control,

  • .readthedocs.yaml - configuration for the ReadTheDocs platform.

  • requirements.txt - lists Python packages required for developers of the package.

  • MANIFEST.in - specifies non-Python files to include in the package that might be ignored by packaging tools.