Skip to main content

Parse files into RAG-Optimized formats.

Project description

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:

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:

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.

Examples

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_parser-0.1.2.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

llama_parser-0.1.2-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page