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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file llama_parser-0.1.2.tar.gz.

File metadata

  • Download URL: llama_parser-0.1.2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.12 Darwin/22.3.0

File hashes

Hashes for llama_parser-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6b7b4c1dfe23573fd0ba09ac7301463fffd493e2b12308948009f0ca5c038a04
MD5 eddd31b2deacb4937af5f56f879ac8bf
BLAKE2b-256 def8a342a438683fe3bdc913c71bf0d8b9579505944ee635392f677e06ab846f

See more details on using hashes here.

File details

Details for the file llama_parser-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: llama_parser-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.12 Darwin/22.3.0

File hashes

Hashes for llama_parser-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 908c69632b4671542743a73ef3574a7c1fa730f70ceed1b2b86b6f69481efd09
MD5 9684a51dfaad175174f28c735ae424df
BLAKE2b-256 a170408f9b2ed393d1b3c70411433b813d35e39919d032030df02df63cab73f8

See more details on using hashes here.

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