| title | emoji | colorFrom | colorTo | sdk | sdk_version | app_file | pinned | license |
|---|---|---|---|---|---|---|---|---|
WizLedger - Monthly Statement Processor |
đź’ł |
indigo |
yellow |
gradio |
4.43.0 |
src/ui.py |
false |
mit |
This project demonstrates a credit card statement assistant that can process PDF statements, perform OCR, and use LangGraph for AI-based transaction corrections.
FinKansis_edited3.mp4
https://huggingface.co/spaces/chinkanai/wizledger
- LangChain
- LangGraph
- MarkItDown
- OpenRouter API (for access Claude 4.5 Sonnet) OpenRouter API
- pdf2image (optional) pdf2image
Here is the graph of the workflow:
graph TD
Start((Start)) --> A[ocr]
A --> B[extract]
B --> C[display_transactions]
C --> D[get_human_input]
D --> E[process_human_input]
E --> F{check_if_done}
F -->|continue| C
F -->|done| G[store_csv]
G --> End((End))
style Start fill:#4CAF50,stroke:#333,stroke-width:2px
style End fill:#FF5722,stroke:#333,stroke-width:2px
- Python 3.10 or later
- OpenRouter API key (Get it here)
-
Clone this repository:
git clone https://github.com/chinkan/demo-ai-statement-extract cd demo-ai-statement-extract -
Configure environment variables:
- Copy
.env.exampleto.env - Fill in the variables in the
.envfile
- Copy
-
Run it
- On Windows
run.bat
- On Linux or MacOS
./run.sh
Processed data will be saved in the output folder.
docker build -t wizledger .Linux/MacOS:
docker run -d -p 7860:7860 \
-e OPENROUTER_MODEL="anthropic/claude-4.5-sonnet" \
-e OPENROUTER_API_URL="https://openrouter.ai/api/v1" \
-e OPENROUTER_API_KEY="<replace with your openrouter api key>" \
wizledgerWindows (PowerShell):
docker run -d -p 7860:7860 `
-e OPENROUTER_MODEL="anthropic/claude-4.5-sonnet" `
-e OPENROUTER_API_URL="https://openrouter.ai/api/v1" `
-e OPENROUTER_API_KEY="<replace with your openrouter api key>" `
wizledgerWindows (Command Prompt):
docker run -d -p 7860:7860 -e OPENROUTER_MODEL="anthropic/claude-4.5-sonnet" -e OPENROUTER_API_URL="https://openrouter.ai/api/v1" -e OPENROUTER_API_KEY="<replace with your openrouter api key>" wizledgerLinux/MacOS:
docker run -it -p 7860:7860 --platform=linux/amd64 \
-e OPENROUTER_MODEL="anthropic/claude-4.5-sonnet" \
-e OPENROUTER_API_URL="https://openrouter.ai/api/v1" \
-e OPENROUTER_API_KEY="<replace with your openrouter api key>" \
registry.hf.space/chinkanai-wizledger:latest python src/ui.pyWindows (PowerShell):
docker run -it -p 7860:7860 --platform=linux/amd64 `
-e OPENROUTER_MODEL="anthropic/claude-4.5-sonnet" `
-e OPENROUTER_API_URL="https://openrouter.ai/api/v1" `
-e OPENROUTER_API_KEY="<replace with your openrouter api key>" `
registry.hf.space/chinkanai-wizledger:latest python src/ui.pyWindows (Command Prompt):
docker run -it -p 7860:7860 --platform=linux/amd64 -e OPENROUTER_MODEL="anthropic/claude-4.5-sonnet" -e OPENROUTER_API_URL="https://openrouter.ai/api/v1" -e OPENROUTER_API_KEY="<replace with your openrouter api key>" registry.hf.space/chinkanai-wizledger:latest python src/ui.pyLinux/MacOS:
docker run -d -p 7860:7860 \
-e OPENROUTER_MODEL="anthropic/claude-4.5-sonnet" \
-e OPENROUTER_API_URL="https://openrouter.ai/api/v1" \
-e OPENROUTER_API_KEY="<replace with your openrouter api key>" \
ghcr.io/chinkan/wizledger-statement-processor:masterWindows (PowerShell):
docker run -d -p 7860:7860 `
-e OPENROUTER_MODEL="anthropic/claude-4.5-sonnet" `
-e OPENROUTER_API_URL="https://openrouter.ai/api/v1" `
-e OPENROUTER_API_KEY="<replace with your openrouter api key>" `
ghcr.io/chinkan/wizledger-statement-processor:masterWindows (Command Prompt):
docker run -d -p 7860:7860 -e OPENROUTER_MODEL="anthropic/claude-4.5-sonnet" -e OPENROUTER_API_URL="https://openrouter.ai/api/v1" -e OPENROUTER_API_KEY="<replace with your openrouter api key>" ghcr.io/chinkan/wizledger-statement-processor:masterimport requests
import json
# Process a new statement
url = "http://localhost:7860/process"
files = {
'statement': ('statement.pdf', open('path/to/statement.pdf', 'rb'), 'application/pdf'),
}
response = requests.post(url, files=files)
result = response.json()
print(result['result'])
thread_id = result['thread_id']
# Continue processing
url = "http://localhost:7860/continue_processing"
data = {
'human_input': 'Some human input',
'thread_id': thread_id
}
response = requests.post(url, json=data)
print(response.json())
result = response.json()
# Export transactions
url = "http://localhost:7860/export_transactions"
data = {'output': json.dumps(result)}
response = requests.post(url, json=data)
# Display the transactions
import pandas as pd
import io
df = pd.read_csv(io.BytesIO(response.content), encoding='utf-8')
display(df)We welcome contributions! To contribute to the project:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them.
- Push to your branch and create a pull request.
This project is licensed under the MIT License.