# chat2pdf
[](https://img.shields.io/pypi/pyversions/chat2pdf)
[](https://pypi.org/project/chat2pdf/)
[](https://erdogant.github.io/chat2pdf/)
[](https://github.com/erdogant/chat2pdf/)
[](https://pepy.tech/project/chat2pdf)
[](https://pepy.tech/project/chat2pdf)
[](https://github.com/erdogant/chat2pdf/blob/master/LICENSE)
[](https://github.com/erdogant/chat2pdf/network)
[](https://github.com/erdogant/chat2pdf/issues)
[](http://www.repostatus.org/#active)
[](https://zenodo.org/badge/latestdoi/228166657)


[](https://erdogant.github.io/chat2pdf/pages/html/Documentation.html#)
<!---[](https://www.buymeacoffee.com/erdogant)-->
<!---[](https://erdogant.github.io/donate/?currency=USD&amount=5)-->
* ``chat2pdf`` is Python package
#
**Star this repo if you like it! ⭐️**
#
### Installation
* Install chat2pdf from PyPI (recommended). chat2pdf is compatible with Python 3.6+ and runs on Linux, MacOS X and Windows.
* A new environment can be created as follows:
```bash
conda create -n env_chat2pdf python=3.12
conda activate env_chat2pdf
```
```bash
pip install chat2pdf # normal install
pip install --upgrade chat2pdf # or update if needed
```
* Alternatively, you can install from the GitHub source:
```bash
# Directly install from github source
pip install -e git://github.com/erdogant/chat2pdf.git@0.1.0#egg=master
pip install git+https://github.com/erdogant/chat2pdf#egg=master
pip install git+https://github.com/erdogant/chat2pdf
# By cloning
git clone https://github.com/erdogant/chat2pdf.git
cd chat2pdf
pip install -U -e .
```
#### Import chat2pdf package
```python
from chat2pdf import chat2pdf
```
#### Example by using PDF files
```python
# Import
from chat2pdf import chat2pdf
# Initialize
client = chat2pdf(model='Phi3')
# Check prompt
print(client.prompt)
client.pdf_read([r'C:\my_personal_pdf.pdf'])
print(client.context)
question = "Create a summary with at most 100 words"
client.question(question)
# print(client.response)
client.question('What was my first question?')
```
#### Example by adding alternatively context:
```python
# Import
from chat2pdf import chat2pdf
# Initialize
client = chat2pdf()
# print the prompt text
print(client.prompt)
# Change prompt:
# client.prompt = "Use Dutch as language."
client.context = """
The Eiffel Tower is a wrought iron lattice tower on the Champ de Mars in Paris, France.
It is named after the engineer Gustave Eiffel, whose company designed and built the tower.
The tower is 324 meters (1,063 ft) tall, about the same height as an 81-story building, and the tallest structure in Paris.
The number of visitors on yearly basis is 10.000.
"""
print(client.context)
# question = "How many people visit the Eiffel Tower?"
# question = "How width is the Eiffel Tower?"
question = "How tall is the Eiffel Tower?"
# Template
print(client.template)
# Now ask the question
client.question(question)
# Reponse
# print(client.response)
```
#### Example by adding directly Context:
```Bash
streamlit run chat2pdf.py
```
<p align="center">
<img src="https://github.com/erdogant/chat2pdf/blob/master/docs/figs/screenshot_gui.png" width="600" />
</p>
#### References
* https://github.com/erdogant/chat2pdf
#### Citation
Please cite in your publications if this is useful for your research (see citation).
### Maintainers
* Erdogan Taskesen, github: [erdogant](https://github.com/erdogant)
### Contribute
* All kinds of contributions are welcome!
* If you wish to buy me a <a href="https://www.buymeacoffee.com/erdogant">Coffee</a> for this work, it is very appreciated :)
### Licence
See [LICENSE](LICENSE) for details.
Raw data
{
"_id": null,
"home_page": "https://github.com/erdogant/chat2pdf",
"name": "chat2pdf",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3",
"maintainer_email": null,
"keywords": null,
"author": "Erdogan Taskesen",
"author_email": "erdogant@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/9c/6a/93a502099a479a3de8387cf60944f0759c0d35ec535512b93cf7fe595de8/chat2pdf-1.0.0.tar.gz",
"platform": null,
"description": "# chat2pdf\r\n\r\n[](https://img.shields.io/pypi/pyversions/chat2pdf)\r\n[](https://pypi.org/project/chat2pdf/)\r\n[](https://erdogant.github.io/chat2pdf/)\r\n[](https://github.com/erdogant/chat2pdf/)\r\n[](https://pepy.tech/project/chat2pdf)\r\n[](https://pepy.tech/project/chat2pdf)\r\n[](https://github.com/erdogant/chat2pdf/blob/master/LICENSE)\r\n[](https://github.com/erdogant/chat2pdf/network)\r\n[](https://github.com/erdogant/chat2pdf/issues)\r\n[](http://www.repostatus.org/#active)\r\n[](https://zenodo.org/badge/latestdoi/228166657)\r\n\r\n\r\n[](https://erdogant.github.io/chat2pdf/pages/html/Documentation.html#)\r\n<!---[](https://www.buymeacoffee.com/erdogant)-->\r\n<!---[](https://erdogant.github.io/donate/?currency=USD&amount=5)-->\r\n\r\n* ``chat2pdf`` is Python package\r\n\r\n# \r\n**Star this repo if you like it! \u2b50\ufe0f**\r\n#\r\n\r\n\r\n### Installation\r\n* Install chat2pdf from PyPI (recommended). chat2pdf is compatible with Python 3.6+ and runs on Linux, MacOS X and Windows. \r\n* A new environment can be created as follows:\r\n\r\n```bash\r\nconda create -n env_chat2pdf python=3.12\r\nconda activate env_chat2pdf\r\n```\r\n\r\n```bash\r\npip install chat2pdf # normal install\r\npip install --upgrade chat2pdf # or update if needed\r\n```\r\n\r\n* Alternatively, you can install from the GitHub source:\r\n```bash\r\n# Directly install from github source\r\npip install -e git://github.com/erdogant/chat2pdf.git@0.1.0#egg=master\r\npip install git+https://github.com/erdogant/chat2pdf#egg=master\r\npip install git+https://github.com/erdogant/chat2pdf\r\n\r\n# By cloning\r\ngit clone https://github.com/erdogant/chat2pdf.git\r\ncd chat2pdf\r\npip install -U -e .\r\n``` \r\n\r\n#### Import chat2pdf package\r\n```python\r\nfrom chat2pdf import chat2pdf\r\n```\r\n\r\n#### Example by using PDF files\r\n```python\r\n\r\n# Import\r\nfrom chat2pdf import chat2pdf\r\n# Initialize\r\nclient = chat2pdf(model='Phi3')\r\n\r\n# Check prompt\r\nprint(client.prompt)\r\n\r\nclient.pdf_read([r'C:\\my_personal_pdf.pdf'])\r\nprint(client.context)\r\n\r\nquestion = \"Create a summary with at most 100 words\"\r\nclient.question(question)\r\n\r\n# print(client.response)\r\nclient.question('What was my first question?')\r\n\r\n```\r\n\r\n\r\n#### Example by adding alternatively context:\r\n```python\r\n\r\n# Import\r\nfrom chat2pdf import chat2pdf\r\n# Initialize\r\nclient = chat2pdf()\r\n\r\n# print the prompt text\r\nprint(client.prompt)\r\n\r\n# Change prompt:\r\n# client.prompt = \"Use Dutch as language.\"\r\n\r\nclient.context = \"\"\"\r\nThe Eiffel Tower is a wrought iron lattice tower on the Champ de Mars in Paris, France.\r\nIt is named after the engineer Gustave Eiffel, whose company designed and built the tower.\r\nThe tower is 324 meters (1,063 ft) tall, about the same height as an 81-story building, and the tallest structure in Paris.\r\nThe number of visitors on yearly basis is 10.000.\r\n\"\"\"\r\nprint(client.context)\r\n\r\n# question = \"How many people visit the Eiffel Tower?\"\r\n# question = \"How width is the Eiffel Tower?\"\r\nquestion = \"How tall is the Eiffel Tower?\"\r\n\r\n# Template\r\nprint(client.template)\r\n\r\n# Now ask the question\r\nclient.question(question)\r\n\r\n# Reponse\r\n# print(client.response)\r\n\r\n```\r\n\r\n#### Example by adding directly Context:\r\n```Bash\r\n\r\nstreamlit run chat2pdf.py\r\n\r\n```\r\n\r\n<p align=\"center\">\r\n <img src=\"https://github.com/erdogant/chat2pdf/blob/master/docs/figs/screenshot_gui.png\" width=\"600\" />\r\n</p>\r\n\r\n\r\n#### References\r\n* https://github.com/erdogant/chat2pdf\r\n\r\n#### Citation\r\nPlease cite in your publications if this is useful for your research (see citation).\r\n \r\n### Maintainers\r\n* Erdogan Taskesen, github: [erdogant](https://github.com/erdogant)\r\n\r\n### Contribute\r\n* All kinds of contributions are welcome!\r\n* If you wish to buy me a <a href=\"https://www.buymeacoffee.com/erdogant\">Coffee</a> for this work, it is very appreciated :)\r\n\r\n### Licence\r\nSee [LICENSE](LICENSE) for details.\r\n",
"bugtrack_url": null,
"license": null,
"summary": "Python package chat2pdf",
"version": "1.0.0",
"project_urls": {
"Download": "https://github.com/erdogant/chat2pdf/archive/1.0.0.tar.gz",
"Homepage": "https://github.com/erdogant/chat2pdf"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2f15b190966bffc2083cb9521c650064f5a0ee6aaae10c9d0b553f172e6d5af3",
"md5": "41fc5c1232f83a533db2c8c2c06b8833",
"sha256": "e9d5261afa3a1c0ef318aa56e963399e8472bc2c3998b79846bcd9c971a63298"
},
"downloads": -1,
"filename": "chat2pdf-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "41fc5c1232f83a533db2c8c2c06b8833",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3",
"size": 10177,
"upload_time": "2024-08-24T17:44:22",
"upload_time_iso_8601": "2024-08-24T17:44:22.871788Z",
"url": "https://files.pythonhosted.org/packages/2f/15/b190966bffc2083cb9521c650064f5a0ee6aaae10c9d0b553f172e6d5af3/chat2pdf-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9c6a93a502099a479a3de8387cf60944f0759c0d35ec535512b93cf7fe595de8",
"md5": "7e57cc4893f3960140b40c4c99844a70",
"sha256": "47755ee63fba1e2aceac0f3ac04e5fe19cbfe1661378fd90528733c9d9fcab39"
},
"downloads": -1,
"filename": "chat2pdf-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "7e57cc4893f3960140b40c4c99844a70",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3",
"size": 9616,
"upload_time": "2024-08-24T17:44:24",
"upload_time_iso_8601": "2024-08-24T17:44:24.435741Z",
"url": "https://files.pythonhosted.org/packages/9c/6a/93a502099a479a3de8387cf60944f0759c0d35ec535512b93cf7fe595de8/chat2pdf-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-24 17:44:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "erdogant",
"github_project": "chat2pdf",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "streamlit",
"specs": []
},
{
"name": "PyPDF2",
"specs": []
},
{
"name": "langchain",
"specs": []
},
{
"name": "langchain-community",
"specs": []
},
{
"name": "langchain_ollama",
"specs": []
},
{
"name": "spacy",
"specs": []
},
{
"name": "faiss-cpu",
"specs": []
}
],
"lcname": "chat2pdf"
}