Name | pdfconverse JSON |
Version |
0.1.3
JSON |
| download |
home_page | None |
Summary | A tool for interacting with PDF documents using AI, allowing page-specific prompts and summaries. PDFConverse leverages Gemini API to provide intelligent responses to queries about PDF content, optimizing token usage and enabling focused analysis of specific page ranges. |
upload_time | 2024-07-05 18:07:24 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | None |
keywords |
ai
document analysis
gemini
pdf
smart reading
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# SmartPDF
PDFConverse is a Python tool that allows you to interact with PDF documents using AI, leveraging the Gemini API to provide intelligent responses to queries about PDF content. It optimizes token usage and enables focused analysis of specific page ranges.
## Features
- Interact with individual pages or page ranges in your PDF
- Run AI-powered prompts on specific sections of your document
- Avoid the problem of passing too much information to the model
- Save tokens by targeting specific pages or ranges
- Built-in sanity checks for better performance and reliability
## Installation
You can install PDFConverse using pip:
```
pip install pdfconverse
```
## Usage
Here's a basic example of how to use PDFConverse:
This example shows how to use it directly from files if you have acccess to underlying file system.
```python
import os
from pdfconverse import PDFConverse
from pdfconverse.models import FilePath,GeminiSetup
# Set up your PDF path and Gemini API key. Assuming you have a .env file with the Gemini API key
file_path = FilePath(path="./path/to/your/document.pdf")
gemini_setup=GeminiSetup(api_key=os.getenv("GEMINI_API_KEY"),model="gemini-1.5-flash")
# Initialize PDFConverse
pdfconverse = PDFConverse(gemini_setup=gemini_setup,file_path=file_path)
# Get a summary of the first page
summary = pdfconverse.page(page_start=0, page_end=0).prompt("Give me a summary")
print(summary)
```
This examples shows where you are streaming eg if you need to use s3
```
file_path = "./src/pdfconverse/samples/gemini_test_file.pdf"
with open(file_path, "rb") as f:
pdf_bytes = BytesIO(f.read())
pdfconverse = PDFConverse(gemini_setup=gemini_setup,bytes=pdf_bytes)
# Get a summary of the first page
summary = pdfconverse.page(page_start=0, page_end=0).prompt("Give me a summary")
print(summary)
```
## Use Cases
1. **Reading Aid**: Use PDFConverse as a reading assistant, summarizing individual pages as you go through a document.
2. **Targeted Analysis**: Focus on specific sections of a large document without processing unnecessary content.
3. **Document Q&A**: Ask questions about particular pages or sections of your PDF.
## Caution
While PDFConverse can summarize or interact with entire books, please be aware that this may lead to expensive bills from the Gemini API. Always monitor your usage and costs.
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Acknowledgments
- Thanks to the Gemini API for powering the AI interactions
- Inspired by the need for more granular control over AI-document interactions
Raw data
{
"_id": null,
"home_page": null,
"name": "pdfconverse",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "ai, document analysis, gemini, pdf, smart reading",
"author": null,
"author_email": "Chencha Jacob <jmokua@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/d9/56/743b81345f001fb716ff1343ded8d6c4d3e08dd1f0f59b8d639c839baeba/pdfconverse-0.1.3.tar.gz",
"platform": null,
"description": "# SmartPDF\n\nPDFConverse is a Python tool that allows you to interact with PDF documents using AI, leveraging the Gemini API to provide intelligent responses to queries about PDF content. It optimizes token usage and enables focused analysis of specific page ranges.\n\n## Features\n\n- Interact with individual pages or page ranges in your PDF\n- Run AI-powered prompts on specific sections of your document\n- Avoid the problem of passing too much information to the model\n- Save tokens by targeting specific pages or ranges\n- Built-in sanity checks for better performance and reliability\n\n## Installation\n\nYou can install PDFConverse using pip:\n\n```\npip install pdfconverse\n```\n\n## Usage\n\nHere's a basic example of how to use PDFConverse:\nThis example shows how to use it directly from files if you have acccess to underlying file system.\n\n```python\nimport os\nfrom pdfconverse import PDFConverse\nfrom pdfconverse.models import FilePath,GeminiSetup\n\n# Set up your PDF path and Gemini API key. Assuming you have a .env file with the Gemini API key\nfile_path = FilePath(path=\"./path/to/your/document.pdf\")\ngemini_setup=GeminiSetup(api_key=os.getenv(\"GEMINI_API_KEY\"),model=\"gemini-1.5-flash\")\n\n# Initialize PDFConverse\npdfconverse = PDFConverse(gemini_setup=gemini_setup,file_path=file_path)\n\n# Get a summary of the first page\nsummary = pdfconverse.page(page_start=0, page_end=0).prompt(\"Give me a summary\")\nprint(summary)\n\n```\n\nThis examples shows where you are streaming eg if you need to use s3\n\n```\nfile_path = \"./src/pdfconverse/samples/gemini_test_file.pdf\"\nwith open(file_path, \"rb\") as f:\n pdf_bytes = BytesIO(f.read())\npdfconverse = PDFConverse(gemini_setup=gemini_setup,bytes=pdf_bytes)\n# Get a summary of the first page\nsummary = pdfconverse.page(page_start=0, page_end=0).prompt(\"Give me a summary\")\nprint(summary)\n```\n\n## Use Cases\n\n1. **Reading Aid**: Use PDFConverse as a reading assistant, summarizing individual pages as you go through a document.\n2. **Targeted Analysis**: Focus on specific sections of a large document without processing unnecessary content.\n3. **Document Q&A**: Ask questions about particular pages or sections of your PDF.\n\n## Caution\n\nWhile PDFConverse can summarize or interact with entire books, please be aware that this may lead to expensive bills from the Gemini API. Always monitor your usage and costs.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- Thanks to the Gemini API for powering the AI interactions\n- Inspired by the need for more granular control over AI-document interactions",
"bugtrack_url": null,
"license": null,
"summary": "A tool for interacting with PDF documents using AI, allowing page-specific prompts and summaries. PDFConverse leverages Gemini API to provide intelligent responses to queries about PDF content, optimizing token usage and enabling focused analysis of specific page ranges.",
"version": "0.1.3",
"project_urls": {
"Documentation": "https://github.com/prodeveloper/pdfconverse?tab=readme-ov-file",
"Issues": "https://github.com/prodeveloper/pdfconverse/issues",
"Source": "https://github.com/prodeveloper/pdfconverse"
},
"split_keywords": [
"ai",
" document analysis",
" gemini",
" pdf",
" smart reading"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "291bc5d19f96df637787d5002fc5a036487a9fa15b15ec6d6b8f78c9d671cfd9",
"md5": "74e51a754b0ac7a8e33e1b0452cb1981",
"sha256": "fcb62851031022d9794cbac30c6c27d6cbc348af2093788caf40862b04fb1eb0"
},
"downloads": -1,
"filename": "pdfconverse-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "74e51a754b0ac7a8e33e1b0452cb1981",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 29849,
"upload_time": "2024-07-05T18:07:25",
"upload_time_iso_8601": "2024-07-05T18:07:25.920263Z",
"url": "https://files.pythonhosted.org/packages/29/1b/c5d19f96df637787d5002fc5a036487a9fa15b15ec6d6b8f78c9d671cfd9/pdfconverse-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "d956743b81345f001fb716ff1343ded8d6c4d3e08dd1f0f59b8d639c839baeba",
"md5": "382fe3c88ada57d65cbe8738ed8c4a18",
"sha256": "419ab46ef2b55b0738b9a673ef3abf7e3963cf05e7ef67a6d37a96195908dcfa"
},
"downloads": -1,
"filename": "pdfconverse-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "382fe3c88ada57d65cbe8738ed8c4a18",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 29204,
"upload_time": "2024-07-05T18:07:24",
"upload_time_iso_8601": "2024-07-05T18:07:24.420731Z",
"url": "https://files.pythonhosted.org/packages/d9/56/743b81345f001fb716ff1343ded8d6c4d3e08dd1f0f59b8d639c839baeba/pdfconverse-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-05 18:07:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "prodeveloper",
"github_project": "pdfconverse?tab=readme-ov-file",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pdfconverse"
}