llama-index-readers-llama-parse


Namellama-index-readers-llama-parse JSON
Version 0.3.0 PyPI version JSON
download
home_pageNone
Summaryllama-index readers llama-parse integration
upload_time2024-09-02 17:36:49
maintainerNone
docs_urlNone
authorLogan Markewich
requires_python<4.0,>=3.8.1
licenseMIT
keywords pdf llama llama-parse parse
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # LlamaParse

LlamaParse is an API created by LlamaIndex to efficiently parse and represent files for efficient retrieval and context augmentation using LlamaIndex frameworks.

LlamaParse directly integrates with [LlamaIndex](https://github.com/run-llama/llama_index).

Currently available for **free**. Try it out today!

## Getting Started

First, login and get an api-key from `https://cloud.llamaindex.ai`.

Then, make sure you have the latest LlamaIndex version installed.

**NOTE:** If you are upgrading from v0.9.X, we recommend following our [migration guide](../../../docs/docs/getting_started/v0_10_0_migration.md), as well as uninstalling your previous version first.

```
pip uninstall llama-index  # run this if upgrading from v0.9.x or older
pip install -U llama-index --upgrade --no-cache-dir --force-reinstall
```

Lastly, install the package:

`pip install llama-parse`

Now you can run the following to parse your first PDF file:

```python
import nest_asyncio

nest_asyncio.apply()

from llama_parse import LlamaParse

parser = LlamaParse(
    api_key="llx-...",  # can also be set in your env as LLAMA_CLOUD_API_KEY
    result_type="markdown",  # "markdown" and "text" are available
    verbose=True,
)

# sync
documents = parser.load_data("./my_file.pdf")

# sync batch
documents = parser.load_data(["./my_file1.pdf", "./my_file2.pdf"])

# async
documents = await parser.aload_data("./my_file.pdf")

# async batch
documents = await parser.aload_data(["./my_file1.pdf", "./my_file2.pdf"])
```

## Using with `SimpleDirectoryReader`

You can also integrate the parser as the default PDF loader in `SimpleDirectoryReader`:

```python
import nest_asyncio

nest_asyncio.apply()

from llama_parse import LlamaParse
from llama_index.core import SimpleDirectoryReader

parser = LlamaParse(
    api_key="llx-...",  # can also be set in your env as LLAMA_CLOUD_API_KEY
    result_type="markdown",  # "markdown" and "text" are available
    verbose=True,
)

file_extractor = {".pdf": parser}
documents = SimpleDirectoryReader(
    "./data", file_extractor=file_extractor
).load_data()
```

Full documentation for `SimpleDirectoryReader` can be found on the [LlamaIndex Documentation](https://docs.llamaindex.ai/en/stable/module_guides/loading/simpledirectoryreader.html).

## Examples

Several end-to-end indexing examples can be found in the examples folder

- [Getting Started](https://github.com/run-llama/llama_parse/blob/main/examples/demo_basic.ipynb)
- [Advanced RAG Example](https://github.com/run-llama/llama_parse/blob/main/examples/demo_advanced.ipynb)
- [Raw API Usage](https://github.com/run-llama/llama_parse/blob/main/examples/demo_api.ipynb)
- [JSON MODE](https://github.com/run-llama/llama_parse/blob/main/examples/demo_json.ipynb)

## Terms of Service

See the [Terms of Service Here](https://github.com/run-llama/llama_parse/blob/main/TOS.pdf).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "llama-index-readers-llama-parse",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8.1",
    "maintainer_email": null,
    "keywords": "PDF, llama, llama-parse, parse",
    "author": "Logan Markewich",
    "author_email": "logan@runllama.ai",
    "download_url": "https://files.pythonhosted.org/packages/04/33/dba0313ac42ca5082e2931a6d15ebfd2e0ffb34390da199639ef6ff378e3/llama_index_readers_llama_parse-0.3.0.tar.gz",
    "platform": null,
    "description": "# LlamaParse\n\nLlamaParse is an API created by LlamaIndex to efficiently parse and represent files for efficient retrieval and context augmentation using LlamaIndex frameworks.\n\nLlamaParse directly integrates with [LlamaIndex](https://github.com/run-llama/llama_index).\n\nCurrently available for **free**. Try it out today!\n\n## Getting Started\n\nFirst, login and get an api-key from `https://cloud.llamaindex.ai`.\n\nThen, make sure you have the latest LlamaIndex version installed.\n\n**NOTE:** If you are upgrading from v0.9.X, we recommend following our [migration guide](../../../docs/docs/getting_started/v0_10_0_migration.md), as well as uninstalling your previous version first.\n\n```\npip uninstall llama-index  # run this if upgrading from v0.9.x or older\npip install -U llama-index --upgrade --no-cache-dir --force-reinstall\n```\n\nLastly, install the package:\n\n`pip install llama-parse`\n\nNow you can run the following to parse your first PDF file:\n\n```python\nimport nest_asyncio\n\nnest_asyncio.apply()\n\nfrom llama_parse import LlamaParse\n\nparser = LlamaParse(\n    api_key=\"llx-...\",  # can also be set in your env as LLAMA_CLOUD_API_KEY\n    result_type=\"markdown\",  # \"markdown\" and \"text\" are available\n    verbose=True,\n)\n\n# sync\ndocuments = parser.load_data(\"./my_file.pdf\")\n\n# sync batch\ndocuments = parser.load_data([\"./my_file1.pdf\", \"./my_file2.pdf\"])\n\n# async\ndocuments = await parser.aload_data(\"./my_file.pdf\")\n\n# async batch\ndocuments = await parser.aload_data([\"./my_file1.pdf\", \"./my_file2.pdf\"])\n```\n\n## Using with `SimpleDirectoryReader`\n\nYou can also integrate the parser as the default PDF loader in `SimpleDirectoryReader`:\n\n```python\nimport nest_asyncio\n\nnest_asyncio.apply()\n\nfrom llama_parse import LlamaParse\nfrom llama_index.core import SimpleDirectoryReader\n\nparser = LlamaParse(\n    api_key=\"llx-...\",  # can also be set in your env as LLAMA_CLOUD_API_KEY\n    result_type=\"markdown\",  # \"markdown\" and \"text\" are available\n    verbose=True,\n)\n\nfile_extractor = {\".pdf\": parser}\ndocuments = SimpleDirectoryReader(\n    \"./data\", file_extractor=file_extractor\n).load_data()\n```\n\nFull documentation for `SimpleDirectoryReader` can be found on the [LlamaIndex Documentation](https://docs.llamaindex.ai/en/stable/module_guides/loading/simpledirectoryreader.html).\n\n## Examples\n\nSeveral end-to-end indexing examples can be found in the examples folder\n\n- [Getting Started](https://github.com/run-llama/llama_parse/blob/main/examples/demo_basic.ipynb)\n- [Advanced RAG Example](https://github.com/run-llama/llama_parse/blob/main/examples/demo_advanced.ipynb)\n- [Raw API Usage](https://github.com/run-llama/llama_parse/blob/main/examples/demo_api.ipynb)\n- [JSON MODE](https://github.com/run-llama/llama_parse/blob/main/examples/demo_json.ipynb)\n\n## Terms of Service\n\nSee the [Terms of Service Here](https://github.com/run-llama/llama_parse/blob/main/TOS.pdf).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "llama-index readers llama-parse integration",
    "version": "0.3.0",
    "project_urls": null,
    "split_keywords": [
        "pdf",
        " llama",
        " llama-parse",
        " parse"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "49b2174bb131b767f9873b9f95b6c216043ccde4cfbeb3bcaf01fa23594f810a",
                "md5": "effef5482ed473ec73d4fd56460fde5d",
                "sha256": "1973cc710dbd5e110c7500c9983ecb45787ad1ff92e6b2113f94a57cf48f3038"
            },
            "downloads": -1,
            "filename": "llama_index_readers_llama_parse-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "effef5482ed473ec73d4fd56460fde5d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8.1",
            "size": 2474,
            "upload_time": "2024-09-02T17:36:48",
            "upload_time_iso_8601": "2024-09-02T17:36:48.231056Z",
            "url": "https://files.pythonhosted.org/packages/49/b2/174bb131b767f9873b9f95b6c216043ccde4cfbeb3bcaf01fa23594f810a/llama_index_readers_llama_parse-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0433dba0313ac42ca5082e2931a6d15ebfd2e0ffb34390da199639ef6ff378e3",
                "md5": "74c8d323030b37a63665df2f7f03b559",
                "sha256": "a5feada0895714dcc41d65dd512c1c38cf70d8ae19947cff82b80d58e6aa367e"
            },
            "downloads": -1,
            "filename": "llama_index_readers_llama_parse-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "74c8d323030b37a63665df2f7f03b559",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8.1",
            "size": 2471,
            "upload_time": "2024-09-02T17:36:49",
            "upload_time_iso_8601": "2024-09-02T17:36:49.507582Z",
            "url": "https://files.pythonhosted.org/packages/04/33/dba0313ac42ca5082e2931a6d15ebfd2e0ffb34390da199639ef6ff378e3/llama_index_readers_llama_parse-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-02 17:36:49",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "llama-index-readers-llama-parse"
}
        
Elapsed time: 0.42969s