A Django app for AI-powered document processing
Project description
Django DocTools
A reusable Django application for document processing, analysis, and summarization using AI.
Features
- Document summarization based on context and document type
- Smart topic generation and analysis
- Support for PDF, DOC, and DOCX files
- Multiple AI providers: Google's Gemini, OpenAI GPT models, and AWS Bedrock
Installation
pip install django-doctools
Usage
- Add "doctools" to your INSTALLED_APPS setting:
INSTALLED_APPS = [
...
'doctools',
]
- Configure your preferred AI provider in settings.py:
# Choose your AI provider: "gemini", "openai", or "bedrock"
DOCTOOLS_AI_PROVIDER = "gemini"
# For Gemini
GEMINI_API_KEY = 'your-gemini-api-key'
# For OpenAI
OPENAI_API_KEY = 'your-openai-api-key'
OPENAI_MODEL_NAME = 'gpt-4o' # Optional, defaults to gpt-4o
# For AWS Bedrock
BEDROCK_MODEL_ID = 'anthropic.claude-v2'
BEDROCK_AWS_REGION_NAME = 'us-east-1'
BEDROCK_AWS_ACCESS_KEY_ID = 'your-aws-access-key'
BEDROCK_AWS_SECRET_ACCESS_KEY = 'your-aws-secret-key'
- Use the document processor in your views:
from doctools.processors import DocumentProcessor
def process_document(request):
context = request.POST.get('context')
doc_type = request.POST.get('doc_type')
topics = request.POST.getlist('topics', None)
document = request.FILES.get('document')
processor = DocumentProcessor()
result = processor.process(
document=document,
context=context,
doc_type=doc_type,
topics=topics
)
return JsonResponse(result)
Development
To contribute to this project:
- Clone the repository
- Install development dependencies:
pip install -e ".[dev]" - Run tests:
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django_doctools-0.1.0.tar.gz
(10.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_doctools-0.1.0.tar.gz.
File metadata
- Download URL: django_doctools-0.1.0.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6617230ead19c1f5c46a677dc46ab7914158f6baf1cf033d6a884a8361cb20d8
|
|
| MD5 |
13ae42e2b493723d3a2cf0400d8dc17d
|
|
| BLAKE2b-256 |
2009e0ed6e7a2248dbd1b50b6dabbe648d620f85e074e19f4d56c0aaaca108dc
|
File details
Details for the file django_doctools-0.1.0-py3-none-any.whl.
File metadata
- Download URL: django_doctools-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8ba6eebbb98954a747edddcf5c9f60e12b6aebbb2fa036257bcd33ed66a5da6
|
|
| MD5 |
f3934111dc924bb4c101031c92a595ca
|
|
| BLAKE2b-256 |
4cb48e8a69a9eba724076b019f4917d8ef1e08f816b65dff16cc8bfb05b84bc0
|