Skip to main content

Haystack integration for the .cv open file format.

Project description

cvfile-haystack

Haystack 2.x converter component 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 component reads the embedded text payloads directly and emits Haystack Document objects ready for indexing.

Install

pip install cvfile-haystack

Use

from haystack_integrations.components.converters.cvfile import CVFileToDocument

converter = CVFileToDocument()
result = converter.run(sources=["resume.cv"])
documents = result["documents"]

for doc in documents:
    print(doc.meta["payload"], doc.meta["mime_type"], len(doc.content))

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

Primary only

If you only want the canonical Markdown copy and want to skip language alternates and supplements:

converter = CVFileToDocument(primary_only=True)

Pipeline use

from haystack import Pipeline
from haystack.components.embedders import SentenceTransformersDocumentEmbedder
from haystack.components.writers import DocumentWriter
from haystack.document_stores.in_memory import InMemoryDocumentStore
from haystack_integrations.components.converters.cvfile import CVFileToDocument

store = InMemoryDocumentStore()
pipe = Pipeline()
pipe.add_component("read", CVFileToDocument(primary_only=True))
pipe.add_component("embed", SentenceTransformersDocumentEmbedder(model="BAAI/bge-m3"))
pipe.add_component("write", DocumentWriter(document_store=store))
pipe.connect("read.documents", "embed.documents")
pipe.connect("embed.documents", "write.documents")

pipe.run({"read": {"sources": ["resumes/jane.cv", "resumes/john.cv"]}})

Metadata fields

Key Description
source The file path (or stream name) the document came from
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

cvfile_haystack-0.2.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

cvfile_haystack-0.2.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file cvfile_haystack-0.2.0.tar.gz.

File metadata

  • Download URL: cvfile_haystack-0.2.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cvfile_haystack-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9d61740f2d40eb290cf594bd5108ced118da339d3ce5580ee880cde3fbc92873
MD5 02befdfe8e95ecdc6f9ee03ee6ef4683
BLAKE2b-256 2730bff05f8d5a87fb01745be8dba868c4d9ea5e686312fa6025d7fdb2d15739

See more details on using hashes here.

Provenance

The following attestation bundles were made for cvfile_haystack-0.2.0.tar.gz:

Publisher: publish-cvfile-haystack.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 cvfile_haystack-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cvfile_haystack-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c98f55711c7e2ad3c3c4b5cf3e6f9748f324a1234ceb0f4504db37aa556f5780
MD5 867d4eef6a1ff99ce1fb46614c9cb388
BLAKE2b-256 8b4f6faacaf4fdd550eb3521cff265951c5acef44f624969caf897841807bf5c

See more details on using hashes here.

Provenance

The following attestation bundles were made for cvfile_haystack-0.2.0-py3-none-any.whl:

Publisher: publish-cvfile-haystack.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