Skip to main content

LlamaIndex reader for the .cv open file format.

Project description

llama-index-readers-cvfile

LlamaIndex reader for the .cv open file format.

A .cv file is a PDF/A-3u file carrying a Markdown copy of the same content (plus optional HTML and JSON Resume) as PDF Associated Files. Instead of OCR ing the PDF, this reader pulls the embedded text payloads directly.

Install

pip install llama-index-readers-cvfile

Use

from pathlib import Path
from llama_index.readers.cvfile import CVFileReader

reader = CVFileReader()
docs = reader.load_data(file=Path("resume.cv"))

for doc in docs:
    print(doc.metadata["payload"], doc.metadata["mime_type"], len(doc.text))

You get one Document per textual payload found in the file. The Markdown copy (typically resume.md) is the one flagged with metadata["primary"] = True.

Untrusted files

By default the reader runs cvfile.validate() before extracting anything. Files carrying forbidden active content (JavaScript, launch or submit actions, external references), encryption, integrity digest mismatches, or payloads over the spec size cap raise ValueError listing the issue codes. Resumes are classic untrusted input, so keep the default when loading files you did not produce yourself.

reader = CVFileReader()              # verify=True (default)
reader = CVFileReader(verify=False)  # trusted files only

Metadata fields

Key Description
source Absolute path to the loaded file
file_name Basename of the source file
payload Name of the embedded file (e.g. resume.md)
mime_type MIME of the payload (text/markdown, text/html, application/json)
relationship PDF Associated Files relationship (Alternative for primary alternates)
language BCP 47 language tag for this payload
primary True for the payload declared as primary in the file's XMP metadata
cv_version Version of the .cv spec the file conforms to
cv_generator Tool that produced the file, if recorded

License

Apache-2.0.

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_index_readers_cvfile-0.3.2.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llama_index_readers_cvfile-0.3.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_readers_cvfile-0.3.2.tar.gz.

File metadata

File hashes

Hashes for llama_index_readers_cvfile-0.3.2.tar.gz
Algorithm Hash digest
SHA256 1f65003a9c6e17d64bcacd570540a302e3eedaabf600a86e37be8d1139e5ffa0
MD5 a099530f3045b35750f53d8c92ab5d08
BLAKE2b-256 472a5d8526d83f2e332e21fa37470d0ad272be05ba99c4adb92ee4a284ffe5e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for llama_index_readers_cvfile-0.3.2.tar.gz:

Publisher: publish-llama-index-readers-cvfile.yml on cvfile/cv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file llama_index_readers_cvfile-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_readers_cvfile-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4f30eb633bee9d91ae80d26198a47169bb77db0d98583075d4fc3bec26cd441c
MD5 9e55ef41e6eca4bd69e7ada09096ba6c
BLAKE2b-256 343fe5cbffcfcc5b0ffcd86c51e94f7a718bf35b97f01fff7af1a6b3f2d9392f

See more details on using hashes here.

Provenance

The following attestation bundles were made for llama_index_readers_cvfile-0.3.2-py3-none-any.whl:

Publisher: publish-llama-index-readers-cvfile.yml on cvfile/cv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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