Sahil Garg commited on
Commit
9542994
Β·
1 Parent(s): c79824c

README.md updated

Browse files
Files changed (1) hide show
  1. README.md +231 -1
README.md CHANGED
@@ -1,2 +1,232 @@
1
  # AGRAccountsAudit
2
- AGRAccountsAudit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # AGRAccountsAudit
2
+
3
+ AGRAccountsAudit 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
+ ## Table of Contents
8
+ 1. [Overview](#overview)
9
+ 2. [Key Features](#key-features)
10
+ 3. [Architecture & Project Structure](#architecture--project-structure)
11
+ 4. [Setup & Installation](#setup--installation)
12
+ 5. [Usage](#usage)
13
+ 6. [API Reference](#api-reference)
14
+ 7. [Development & Contribution](#development--contribution)
15
+ 8. [License](#license)
16
+
17
+ ---
18
+
19
+ ## Overview
20
+
21
+ AGRAccountsAudit 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
+ - `app/` β€” FastAPI API endpoints, business logic, and utility modules
42
+ - `pnlbs/` β€” Financial extraction and reporting scripts (P&L, BS, CF)
43
+ - `config/` β€” Mapping and rules (JSON) for data normalization and extraction
44
+ - `input/` β€” Uploaded Excel files (source data)
45
+ - `output*` β€” Generated output files (Excel, JSON)
46
+ - `csv_notes_pnl/`, `generated_notes*`, `balancesheet_excel/`, `cashflow_excel/`, `pnl_excel/` β€” Intermediate and final report folders
47
+ - `requirements.txt` β€” Python dependencies
48
+ - `Dockerfile`, `docker-compose.yml` β€” Containerization assets
49
+ - `.env` β€” Environment configuration
50
+
51
+ ## Setup & Installation
52
+
53
+ ### Prerequisites
54
+ - Python 3.9+
55
+ - pip
56
+ - Docker (optional)
57
+
58
+ ### Clone the Repository
59
+ ```sh
60
+ git clone https://github.com/santhoshmallojwala/AGRAccountsAudit.git
61
+ cd AGRAccountsAudit
62
+ ```
63
+
64
+ ### Install Python Dependencies
65
+ ```sh
66
+ pip install -r requirements.txt
67
+ ```
68
+
69
+ ### Configure Environment
70
+ - Place your Excel trial balance(s) in the `input/` directory
71
+ - Edit `.env` for custom settings (API keys, file paths, etc.)
72
+
73
+ ## Usage
74
+
75
+ ### Run the API Server (Development)
76
+ ```sh
77
+ uvicorn app.api:app --reload
78
+ ```
79
+
80
+ ### Batch Processing via Scripts
81
+ ```sh
82
+ python pnlbs/sircodepnl.py
83
+ python pnlbs/csv_json_pnl.py
84
+ python pnlbs/pnl_note.py
85
+ ```
86
+
87
+ ### Docker Deployment
88
+ ```sh
89
+ docker-compose up --build
90
+ ```
91
+
92
+ ## API Reference
93
+
94
+ ### API Endpoints
95
+
96
+ #### `POST /pnl_from_notes`
97
+ **Description:** Upload an Excel file, run the full P&L pipeline, and receive the generated Profit & Loss statement as an Excel file.
98
+ **Input:**
99
+ - `file` (required): Excel file (`.xlsx`) containing trial balance data. Use `multipart/form-data`.
100
+ **Output:**
101
+ - JSON object with message and file path to the generated P&L Excel file.
102
+ ```json
103
+ {
104
+ "message": "Profit and Loss statement generated successfully.",
105
+ "file": "pnl_statement.xlsx"
106
+ }
107
+ ```
108
+
109
+ #### `POST /bs_from_notes`
110
+ **Description:** Upload an Excel file, run the full Balance Sheet pipeline, and receive the generated Balance Sheet as an Excel file.
111
+ **Input:**
112
+ - `file` (required): Excel file (`.xlsx`) containing trial balance data. Use `multipart/form-data`.
113
+ **Output:**
114
+ - JSON object with message and file path to the generated Balance Sheet Excel file.
115
+ ```json
116
+ {
117
+ "message": "Balance Sheet generated successfully.",
118
+ "file": "balance_sheet.xlsx"
119
+ }
120
+ ```
121
+
122
+ #### `POST /cf`
123
+ **Description:** Generate a Cash Flow statement from existing data (no file upload required).
124
+ **Input:**
125
+ - No input required.
126
+ **Output:**
127
+ - JSON object with message and file path to the generated Cash Flow Excel file.
128
+ ```json
129
+ {
130
+ "message": "Cash Flow report generated successfully as 'cashflow_excel/cashflow_report.xlsx'."
131
+ }
132
+ ```
133
+
134
+ #### `POST /notes/json`
135
+ **Description:** Upload an Excel file and generate notes as JSON. Optionally filter by note number.
136
+ **Input:**
137
+ - `file` (required): Excel file (`.xlsx`) containing trial balance data. Use `multipart/form-data`.
138
+ - `note_number` (optional): Comma-separated string of note numbers to filter (e.g., `16,17,18`).
139
+ **Output:**
140
+ - JSON object containing a list of notes.
141
+ ```json
142
+ {
143
+ "notes": [ ... ]
144
+ }
145
+ ```
146
+
147
+ #### `POST /notes/text`
148
+ **Description:** Upload an Excel file and generate notes as Markdown text. Optionally filter by note number.
149
+ **Input:**
150
+ - `file` (required): Excel file (`.xlsx`) containing trial balance data. Use `multipart/form-data`.
151
+ - `note_number` (optional): Comma-separated string of note numbers to filter.
152
+ **Output:**
153
+ - Plain text (Markdown) containing the generated notes.
154
+
155
+ #### `POST /cf`
156
+ **Description:** Generate a Cash Flow statement. No file upload required.
157
+ **Input:** None.
158
+ **Output:**
159
+ - JSON object with message and file path to the generated Cash Flow Excel file.
160
+ ```json
161
+ {
162
+ "message": "Cash Flow report generated successfully as 'cashflow_excel/cashflow_report.xlsx'."
163
+ }
164
+ ```
165
+
166
+ #### `POST /bs`
167
+ **Description:** Generate a Balance Sheet from existing data. No file upload required.
168
+ **Input:** None.
169
+ **Output:**
170
+ - JSON object with message and file path to the generated Balance Sheet Excel file.
171
+ ```json
172
+ {
173
+ "message": "Balance Sheet report generated successfully as 'balancesheet_excel/balancesheet_report.xlsx'."
174
+ }
175
+ ```
176
+
177
+ #### `POST /pnl`
178
+ **Description:** Generate a Profit & Loss statement from existing data. No file upload required.
179
+ **Input:** None.
180
+ **Output:**
181
+ - JSON object with message and file path to the generated P&L Excel file.
182
+ ```json
183
+ {
184
+ "message": "P&L report generated successfully as 'pnl_excel/pnl_report.xlsx'."
185
+ }
186
+ ```
187
+
188
+ #### `POST /new`
189
+ **Description:** Upload an Excel file and generate notes using LLM, saved as Excel. Optionally filter by note number.
190
+ **Input:**
191
+ - `file` (required): Excel file (`.xlsx`) containing trial balance data. Use `multipart/form-data`.
192
+ - `note_number` (optional): Comma-separated string of note numbers to filter.
193
+ **Output:**
194
+ - JSON object with message and file path to the generated notes Excel file.
195
+ ```json
196
+ {
197
+ "message": "Notes generated. Excel saved at generated_notes_excel/notes.xlsx."
198
+ }
199
+ ```
200
+
201
+ #### `POST /hardcoded`
202
+ **Description:** Run the full hardcoded pipeline: extract, process, filter, and convert to Excel. Optionally filter by note number.
203
+ **Input:**
204
+ - `file` (required): Excel file (`.xlsx`) containing trial balance data. Use `multipart/form-data`.
205
+ - `note_number` (optional): Comma-separated string of note numbers to filter.
206
+ **Output:**
207
+ - JSON object with message and file path to the generated Excel file.
208
+ ```json
209
+ {
210
+ "message": "Pipeline completed successfully. Excel file saved in output3."
211
+ }
212
+ ```
213
+
214
+ ## Development & Contribution
215
+
216
+ ### Local Development
217
+ - Fork and clone the repository
218
+ - Create a feature branch (`git checkout -b feature/my-feature`)
219
+ - Commit and push changes
220
+ - Submit a pull request
221
+
222
+ ### Coding Standards
223
+ - PEP8 compliance
224
+ - Type annotations and docstrings
225
+ - Logging and error handling for all modules
226
+
227
+ ### Issue Tracking
228
+ - Use GitHub Issues for bugs, enhancements, and feature requests
229
+
230
+ ## License
231
+
232
+ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.