Spaces:
Sleeping
Sleeping
Sahil Garg
commited on
Commit
Β·
08c64dd
1
Parent(s):
fd405b3
Add README.md with Hugging Face Space metadata
Browse files
README.md
CHANGED
|
@@ -1,239 +1,8 @@
|
|
| 1 |
-
# FinRyver
|
| 2 |
-
|
| 3 |
-
FinRyver is an enterprise-grade financial statement automation platform built with Python and FastAPI. It streamlines the extraction, transformation, and reporting of financial data from Excel trial balances, enabling rapid generation of standardized Profit & Loss, Balance Sheet, and Cash Flow statements. The solution is designed for professional accounting, audit, and finance teams seeking robust, scalable, and auditable automation.
|
| 4 |
-
|
| 5 |
---
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
6. [API Reference](#api-reference)
|
| 14 |
-
7. [Development & Contribution](#development--contribution)
|
| 15 |
-
8. [License](#license)
|
| 16 |
-
|
| 17 |
-
---
|
| 18 |
-
|
| 19 |
-
## Overview
|
| 20 |
-
|
| 21 |
-
FinRyver automates the end-to-end workflow for financial statement preparation:
|
| 22 |
-
- Ingest Excel trial balances and supporting schedules
|
| 23 |
-
- Extract, normalize, and map financial data using configurable rules
|
| 24 |
-
- Generate P&L, Balance Sheet, and Cash Flow statements in Excel and JSON formats
|
| 25 |
-
- Produce audit-ready notes and disclosures, with optional LLM-powered enrichment
|
| 26 |
-
- Deployable as a REST API or via batch scripts; supports containerization for cloud/on-premise environments
|
| 27 |
-
|
| 28 |
-
## Key Features
|
| 29 |
-
|
| 30 |
-
- **Excel Upload & Parsing:** Accepts complex trial balances and schedules in Excel format
|
| 31 |
-
- **Automated Data Extraction:** Configurable mapping and rules for robust data normalization
|
| 32 |
-
- **Financial Statement Generation:** Produces P&L, Balance Sheet, and Cash Flow statements in standardized formats
|
| 33 |
-
- **Notes & Disclosures:** Generates notes in JSON/Markdown, with LLM integration for advanced commentary
|
| 34 |
-
- **RESTful API:** FastAPI-powered endpoints for seamless integration with other systems
|
| 35 |
-
- **Scriptable Pipeline:** Modular Python scripts for batch processing and automation
|
| 36 |
-
- **Docker Support:** Ready for containerized deployment in CI/CD or cloud environments
|
| 37 |
-
- **Audit Trail:** Logging and error handling for traceability and compliance
|
| 38 |
-
|
| 39 |
-
## Architecture & Project Structure
|
| 40 |
-
|
| 41 |
-
- `notes/` β Main FastAPI API endpoints, business logic, and utility modules
|
| 42 |
-
- `pnl/` β Scripts for Profit & Loss statement processing
|
| 43 |
-
- `bs/` β Scripts for Balance Sheet processing
|
| 44 |
-
- `cf/` β Scripts for Cash Flow statement processing
|
| 45 |
-
- `config/` β Mapping and rules (JSON) for data normalization and extraction
|
| 46 |
-
- `data/` β All input, output, and intermediate files (Excel, JSON, etc.)
|
| 47 |
-
- `data/input/` β Uploaded Excel files (source data)
|
| 48 |
-
- `data/output1/`, `data/output2/`, `data/output3/` β Intermediate and final output files
|
| 49 |
-
- `data/csv_notes_pnl/`, `data/csv_notes_bs/`, `data/csv_notes_cfs/` β Extracted notes in CSV format
|
| 50 |
-
- `data/generated_notes/`, `data/generated_notes_excel/` β Generated notes in JSON/Excel
|
| 51 |
-
- `requirements.txt` β Python dependencies
|
| 52 |
-
- `Dockerfile`, `docker-compose.yml` β Containerization assets
|
| 53 |
-
- `.env` β Environment configuration
|
| 54 |
-
|
| 55 |
-
## Setup & Installation
|
| 56 |
-
|
| 57 |
-
### Prerequisites
|
| 58 |
-
- Python 3.9+
|
| 59 |
-
- pip
|
| 60 |
-
- Docker (optional)
|
| 61 |
-
|
| 62 |
-
### Clone the Repository
|
| 63 |
-
```sh
|
| 64 |
-
git clone https://github.com/santhoshmallojwala/FinRyver.git
|
| 65 |
-
cd FinRyver
|
| 66 |
-
```
|
| 67 |
-
|
| 68 |
-
### Install Python Dependencies
|
| 69 |
-
```sh
|
| 70 |
-
pip install -r requirements.txt
|
| 71 |
-
```
|
| 72 |
-
|
| 73 |
-
### Configure Environment
|
| 74 |
-
- Place your Excel trial balance(s) in the `input/` directory
|
| 75 |
-
- Edit `.env` for custom settings (API keys, file paths, etc.)
|
| 76 |
-
|
| 77 |
-
## Usage
|
| 78 |
-
|
| 79 |
-
### Run the API Server (Development)
|
| 80 |
-
```sh
|
| 81 |
-
uvicorn app:app --reload
|
| 82 |
-
```
|
| 83 |
-
or if your main entrypoint is `main.py`:
|
| 84 |
-
```sh
|
| 85 |
-
uvicorn main:app --reload
|
| 86 |
-
```
|
| 87 |
-
|
| 88 |
-
### Batch Processing via Scripts
|
| 89 |
-
```sh
|
| 90 |
-
python pnl/sircodepnl.py
|
| 91 |
-
python pnl/csv_json_pnl.py
|
| 92 |
-
python pnl/pnl_note.py
|
| 93 |
-
```
|
| 94 |
-
|
| 95 |
-
### Docker Deployment
|
| 96 |
-
```sh
|
| 97 |
-
docker-compose up --build
|
| 98 |
-
```
|
| 99 |
-
|
| 100 |
-
## API Reference
|
| 101 |
-
|
| 102 |
-
### API Endpoints
|
| 103 |
-
|
| 104 |
-
#### `POST /pnl_from_notes`
|
| 105 |
-
**Description:** Upload an Excel file, run the full P&L pipeline, and receive the generated Profit & Loss statement as an Excel file.
|
| 106 |
-
**Input:**
|
| 107 |
-
- `file` (required): Excel file (`.xlsx`) containing trial balance data. Use `multipart/form-data`.
|
| 108 |
-
**Output:**
|
| 109 |
-
- Returns the generated P&L Excel file as a download.
|
| 110 |
-
```json
|
| 111 |
-
{
|
| 112 |
-
"file": "pnl_statement.xlsx"
|
| 113 |
-
}
|
| 114 |
-
```
|
| 115 |
-
|
| 116 |
-
#### `POST /bs_from_notes`
|
| 117 |
-
**Description:** Upload an Excel file, run the full Balance Sheet pipeline, and receive the generated Balance Sheet as an Excel file.
|
| 118 |
-
**Input:**
|
| 119 |
-
- `file` (required): Excel file (`.xlsx`) containing trial balance data. Use `multipart/form-data`.
|
| 120 |
-
**Output:**
|
| 121 |
-
- Returns the generated Balance Sheet Excel file as a download.
|
| 122 |
-
```json
|
| 123 |
-
{
|
| 124 |
-
"file": "balance_sheet.xlsx"
|
| 125 |
-
}
|
| 126 |
-
```
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
#### `POST /cf_from_notes`
|
| 130 |
-
**Description:** Upload an Excel file, run the full Cash Flow pipeline, and receive the generated Cash Flow statement as an Excel file.
|
| 131 |
-
**Input:**
|
| 132 |
-
- `file` (required): Excel file (`.xlsx`) containing trial balance data. Use `multipart/form-data`.
|
| 133 |
-
**Output:**
|
| 134 |
-
- Returns the generated Cash Flow Excel file as a download.
|
| 135 |
-
```json
|
| 136 |
-
{
|
| 137 |
-
"file": "cash_flow_statements.xlsx"
|
| 138 |
-
}
|
| 139 |
-
```
|
| 140 |
-
|
| 141 |
-
#### `POST /notes/json`
|
| 142 |
-
**Description:** Upload an Excel file and generate notes as JSON. Optionally filter by note number.
|
| 143 |
-
**Input:**
|
| 144 |
-
- `file` (required): Excel file (`.xlsx`) containing trial balance data. Use `multipart/form-data`.
|
| 145 |
-
- `note_number` (optional): Comma-separated string of note numbers to filter (e.g., `16,17,18`).
|
| 146 |
-
**Output:**
|
| 147 |
-
- JSON object containing a list of notes.
|
| 148 |
-
```json
|
| 149 |
-
{
|
| 150 |
-
"notes": [ ... ]
|
| 151 |
-
}
|
| 152 |
-
```
|
| 153 |
-
|
| 154 |
-
#### `POST /notes/text`
|
| 155 |
-
**Description:** Upload an Excel file and generate notes as Markdown text. Optionally filter by note number.
|
| 156 |
-
**Input:**
|
| 157 |
-
- `file` (required): Excel file (`.xlsx`) containing trial balance data. Use `multipart/form-data`.
|
| 158 |
-
- `note_number` (optional): Comma-separated string of note numbers to filter.
|
| 159 |
-
**Output:**
|
| 160 |
-
- Plain text (Markdown) containing the generated notes.
|
| 161 |
-
|
| 162 |
-
#### `POST /cf`
|
| 163 |
-
**Description:** Generate a Cash Flow statement. No file upload required.
|
| 164 |
-
**Input:** None.
|
| 165 |
-
**Output:**
|
| 166 |
-
- JSON object with message and file path to the generated Cash Flow Excel file.
|
| 167 |
-
```json
|
| 168 |
-
{
|
| 169 |
-
"message": "Cash Flow report generated successfully as 'cashflow_excel/cashflow_report.xlsx'."
|
| 170 |
-
}
|
| 171 |
-
```
|
| 172 |
-
|
| 173 |
-
#### `POST /bs`
|
| 174 |
-
**Description:** Generate a Balance Sheet from existing data. No file upload required.
|
| 175 |
-
**Input:** None.
|
| 176 |
-
**Output:**
|
| 177 |
-
- JSON object with message and file path to the generated Balance Sheet Excel file.
|
| 178 |
-
```json
|
| 179 |
-
{
|
| 180 |
-
"message": "Balance Sheet report generated successfully as 'balancesheet_excel/balancesheet_report.xlsx'."
|
| 181 |
-
}
|
| 182 |
-
```
|
| 183 |
-
|
| 184 |
-
#### `POST /pnl`
|
| 185 |
-
**Description:** Generate a Profit & Loss statement from existing data. No file upload required.
|
| 186 |
-
**Input:** None.
|
| 187 |
-
**Output:**
|
| 188 |
-
- JSON object with message and file path to the generated P&L Excel file.
|
| 189 |
-
```json
|
| 190 |
-
{
|
| 191 |
-
"message": "P&L report generated successfully as 'pnl_excel/pnl_report.xlsx'."
|
| 192 |
-
}
|
| 193 |
-
```
|
| 194 |
-
|
| 195 |
-
#### `POST /new`
|
| 196 |
-
**Description:** Upload an Excel file and generate notes using LLM, saved as Excel. Optionally filter by note number.
|
| 197 |
-
**Input:**
|
| 198 |
-
- `file` (required): Excel file (`.xlsx`) containing trial balance data. Use `multipart/form-data`.
|
| 199 |
-
- `note_number` (optional): Comma-separated string of note numbers to filter.
|
| 200 |
-
**Output:**
|
| 201 |
-
- JSON object with message and file path to the generated notes Excel file.
|
| 202 |
-
```json
|
| 203 |
-
{
|
| 204 |
-
"message": "Notes generated. Excel saved at generated_notes_excel/notes.xlsx."
|
| 205 |
-
}
|
| 206 |
-
```
|
| 207 |
-
|
| 208 |
-
#### `POST /hardcoded`
|
| 209 |
-
**Description:** Run the full hardcoded pipeline: extract, process, filter, and convert to Excel. Optionally filter by note number.
|
| 210 |
-
**Input:**
|
| 211 |
-
- `file` (required): Excel file (`.xlsx`) containing trial balance data. Use `multipart/form-data`.
|
| 212 |
-
- `note_number` (optional): Comma-separated string of note numbers to filter.
|
| 213 |
-
**Output:**
|
| 214 |
-
- JSON object with message and file path to the generated Excel file.
|
| 215 |
-
```json
|
| 216 |
-
{
|
| 217 |
-
"message": "Pipeline completed successfully. Excel file saved in output3."
|
| 218 |
-
}
|
| 219 |
-
```
|
| 220 |
-
|
| 221 |
-
## Development & Contribution
|
| 222 |
-
|
| 223 |
-
### Local Development
|
| 224 |
-
- Fork and clone the repository
|
| 225 |
-
- Create a feature branch (`git checkout -b feature/my-feature`)
|
| 226 |
-
- Commit and push changes
|
| 227 |
-
- Submit a pull request
|
| 228 |
-
|
| 229 |
-
### Coding Standards
|
| 230 |
-
- PEP8 compliance
|
| 231 |
-
- Type annotations and docstrings
|
| 232 |
-
- Logging and error handling for all modules
|
| 233 |
-
|
| 234 |
-
### Issue Tracking
|
| 235 |
-
- Use GitHub Issues for bugs, enhancements, and feature requests
|
| 236 |
-
|
| 237 |
-
## License
|
| 238 |
-
|
| 239 |
-
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: FinRyver
|
| 3 |
+
emoji: π
|
| 4 |
+
colorFrom: yellow
|
| 5 |
+
colorTo: yellow
|
| 6 |
+
sdk: docker
|
| 7 |
+
pinned: false
|
| 8 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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