Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saherpathan/invoicify-ai-cohere
A Flask application that extracts invoice details from uploaded PDFs and images using LLM inference API
https://github.com/saherpathan/invoicify-ai-cohere
cohereapi flask-application llm-inference ocr pdfplumber python3
Last synced: about 9 hours ago
JSON representation
A Flask application that extracts invoice details from uploaded PDFs and images using LLM inference API
- Host: GitHub
- URL: https://github.com/saherpathan/invoicify-ai-cohere
- Owner: Saherpathan
- License: mit
- Created: 2024-08-09T23:14:47.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-15T20:08:13.000Z (5 months ago)
- Last Synced: 2024-11-19T04:01:25.674Z (2 months ago)
- Topics: cohereapi, flask-application, llm-inference, ocr, pdfplumber, python3
- Language: Python
- Homepage: https://drive.google.com/file/d/17prnudMd1YySwa7O2XRlWuD709Eb5e3m/view?usp=sharing
- Size: 543 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Invoicify-AI π§Ύπ
A Flask application that extracts invoice details from uploaded PDFs and images using `pdfplumber`, `pytesseract`, and the Cohere API for natural language processing. The extracted data is displayed in a user-friendly format and can be downloaded as JSON.
## β¨ Features
- **π Upload PDF or Image Files**: Supports PDFs and images in PNG, JPG, JPEG formats.
- **π€ AI-Powered Extraction**: Utilizes Cohere API to extract invoice details such as customer information, product details, and total amount.
- **πUser-Friendly Interface**: Simple and intuitive UI for uploading files and viewing results.
- **πΎ Downloadable JSON**: Extracted data can be downloaded as a JSON file.
- **π Deployment Support**: Ready for deployment on Vercel.## π Getting Started
### Prerequisites
- π Python 3.8+
- π¦ `pip` (Python package installer)
- π [Cohere API key](https://cohere.ai/) (Add this to a `.env` file)### Installation
1. **π Clone the Repository**
```bash
git clone https://github.com/Saherpathan/invoicify-ai-cohere.git
cd invoicify-ai-cohere
```2. **π Create a Virtual Environment and Activate It**
```bash
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
```3. **π₯ Install the Required Dependencies**
```bash
pip install -r requirements.txt
```4. **π§Set Up Environment Variables**
Create a `.env` file in the root directory and add your Cohere API key:
```env
COHERE_API_KEY=
```5. **βΆοΈ Run the Flask Application Locally**
```bash
python api_call.py
```The app will be accessible at [http://127.0.0.1:5000](http://127.0.0.1:5000).
## Deployment
### Deploying to Vercel
1. **π Install Vercel CLI**
```bash
npm install -g vercel
```2. **πDeploy Your Application**
```bash
vercel
```Follow the prompts to deploy. Vercel will provide you with a URL where your app is live.
### π Environment Setup on Vercel
When deploying to Vercel, make sure to set the `COHERE_API_KEY` in the Environment Variables settings on the Vercel dashboard.
## Folder Structure
```bash
invoicify-ai-cohere/
β
βββ requirements.txt # Python dependencies
βββ vercel.json # Vercel deployment configuration
βββ .env # Environment variables
βββ /api # Main Flask application script
| βββ api_call.py
β βββ/templates
β βββ index.html # Home page for file uploads
β βββ result.html # Result page displaying extracted details
βββ /output # JSON outputs of extracted details
βββ /uploads # Uploaded files
βββ README.md # Project documentation
```## π€ Contributing
We welcome contributions to this project. To contribute:
1. **Fork the Repository**: Click the "Fork" button at the top right of this repository.
2. **Create a New Branch**:
```bash
git checkout -b feature/your-feature-name
```3. **Commit Your Changes**:
```bash
git commit -m "Add your message here"
```4. **Push to the Branch**:
```bash
git push origin feature/your-feature-name
```5. **Submit a Pull Request**: Open a pull request to the `main` branch with a description of your changes.
## π License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## βοΈ Contact
For any questions or suggestions, please contact: [[email protected]](mailto:[email protected])