llama-parser


Namellama-parser JSON
Version 0.1.2 PyPI version JSON
download
home_page
SummaryParse files into RAG-Optimized formats.
upload_time2024-02-02 01:52:46
maintainer
docs_urlNone
authorLogan Markewich
requires_python>=3.8.1,<4.0
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Llama Parser (Preview)

Llama Parser is an API created by LlamaIndex to effeciently parse and represent files for effecient retrieval and context augmentation using LlamaIndex frameworks.

Available for free as a preivew, you can try it out today.

**NOTE:** Currently, only PDF files are supported.

## Getting Started

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

Simply install the package:

`pip install llama-parser`

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

```python
from llama_parser import LlamaParser

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

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

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

## Using with `SimpleDirectoryReader`

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

```python
from llama_parser import LlamaParser
from llama_index import SimpleDirectoryReader

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

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

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

- [Getting Started](examples/demo_basic.ipynb)
- [Advanced RAG Example](examples/demo_advanced.ipynb)
- [Raw API Usage](examples/demo_api.ipynb)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "llama-parser",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8.1,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Logan Markewich",
    "author_email": "logan@llamaindex.ai",
    "download_url": "https://files.pythonhosted.org/packages/de/f8/a342a438683fe3bdc913c71bf0d8b9579505944ee635392f677e06ab846f/llama_parser-0.1.2.tar.gz",
    "platform": null,
    "description": "# Llama Parser (Preview)\n\nLlama Parser is an API created by LlamaIndex to effeciently parse and represent files for effecient retrieval and context augmentation using LlamaIndex frameworks.\n\nAvailable for free as a preivew, you can try it out today.\n\n**NOTE:** Currently, only PDF files are supported.\n\n## Getting Started\n\nFirst, login and get an api-key from `https://cloud.llamaindex.ai`.\n\nSimply install the package:\n\n`pip install llama-parser`\n\nThen, you can run the following to parse your first PDF file:\n\n```python\nfrom llama_parser import LlamaParser\n\nparser = LlamaParser(\n    api_key=\"...\",  # can also be set in your env as LLAMA_CLOUD_API_KEY\n    result_type=\"markdown\"  # \"markdown\" and \"text\" are available\n)\n\n# sync\ndocuments = parser.load_data(\"./my_file.pdf\")\n\n# async\ndocuments = await parser.aload_data(\"./my_file.pdf\")\n```\n\n## Using with `SimpleDirectoryReader`\n\nYou can also integrate the parser as the default PDF loader in `SimpleDirectoryReader`:\n\n```python\nfrom llama_parser import LlamaParser\nfrom llama_index import SimpleDirectoryReader\n\nparser = LlamaParser(\n    api_key=\"...\",  # can also be set in your env as LLAMA_CLOUD_API_KEY\n    result_type=\"markdown\"  # \"markdown\" and \"text\" are available\n)\n\nfile_extractor = {\".pdf\": parser}\ndocuments = SimpleDirectoryReader(\"./data\", file_extractor=file_extractor).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\nServeral end-to-end indexing examples can be found in the examples folder\n\n- [Getting Started](examples/demo_basic.ipynb)\n- [Advanced RAG Example](examples/demo_advanced.ipynb)\n- [Raw API Usage](examples/demo_api.ipynb)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Parse files into RAG-Optimized formats.",
    "version": "0.1.2",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a170408f9b2ed393d1b3c70411433b813d35e39919d032030df02df63cab73f8",
                "md5": "9684a51dfaad175174f28c735ae424df",
                "sha256": "908c69632b4671542743a73ef3574a7c1fa730f70ceed1b2b86b6f69481efd09"
            },
            "downloads": -1,
            "filename": "llama_parser-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9684a51dfaad175174f28c735ae424df",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8.1,<4.0",
            "size": 4214,
            "upload_time": "2024-02-02T01:52:44",
            "upload_time_iso_8601": "2024-02-02T01:52:44.636965Z",
            "url": "https://files.pythonhosted.org/packages/a1/70/408f9b2ed393d1b3c70411433b813d35e39919d032030df02df63cab73f8/llama_parser-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "def8a342a438683fe3bdc913c71bf0d8b9579505944ee635392f677e06ab846f",
                "md5": "eddd31b2deacb4937af5f56f879ac8bf",
                "sha256": "6b7b4c1dfe23573fd0ba09ac7301463fffd493e2b12308948009f0ca5c038a04"
            },
            "downloads": -1,
            "filename": "llama_parser-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "eddd31b2deacb4937af5f56f879ac8bf",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8.1,<4.0",
            "size": 3494,
            "upload_time": "2024-02-02T01:52:46",
            "upload_time_iso_8601": "2024-02-02T01:52:46.348044Z",
            "url": "https://files.pythonhosted.org/packages/de/f8/a342a438683fe3bdc913c71bf0d8b9579505944ee635392f677e06ab846f/llama_parser-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-02 01:52:46",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "llama-parser"
}
        
Elapsed time: 0.21874s