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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cvfile_haystack-0.1.0.tar.gz.
File metadata
- Download URL: cvfile_haystack-0.1.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccc6b38349df78108cbc9264362c4bb7ebf6ff96c856541b95154294df7ecc91
|
|
| MD5 |
6498878c3ac1e01bb3a150b0442329c0
|
|
| BLAKE2b-256 |
c4637fb6bd212b6b7976dd0c3d37d199a544ffab586d0b9b1ad3ee4704f51cfa
|
Provenance
The following attestation bundles were made for cvfile_haystack-0.1.0.tar.gz:
Publisher:
publish-cvfile-haystack.yml on cvfile/cv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cvfile_haystack-0.1.0.tar.gz -
Subject digest:
ccc6b38349df78108cbc9264362c4bb7ebf6ff96c856541b95154294df7ecc91 - Sigstore transparency entry: 1519976477
- Sigstore integration time:
-
Permalink:
cvfile/cv@ef9680eda343845fbc4f286a1081694d77dec56f -
Branch / Tag:
refs/tags/cvfile-haystack/v0.1.0 - Owner: https://github.com/cvfile
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-cvfile-haystack.yml@ef9680eda343845fbc4f286a1081694d77dec56f -
Trigger Event:
push
-
Statement type:
File details
Details for the file cvfile_haystack-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cvfile_haystack-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02217d25ad949f5b4d3f45cb6b70d1fa9046e3d021a4dbf92dbf7fba71c83b33
|
|
| MD5 |
a5fa49da12571931f75840d3446ffb0c
|
|
| BLAKE2b-256 |
4c4e1a127d4f8a4280253a6d95b9132c41224beb1edfbf7a88a20d68413da912
|
Provenance
The following attestation bundles were made for cvfile_haystack-0.1.0-py3-none-any.whl:
Publisher:
publish-cvfile-haystack.yml on cvfile/cv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cvfile_haystack-0.1.0-py3-none-any.whl -
Subject digest:
02217d25ad949f5b4d3f45cb6b70d1fa9046e3d021a4dbf92dbf7fba71c83b33 - Sigstore transparency entry: 1519976480
- Sigstore integration time:
-
Permalink:
cvfile/cv@ef9680eda343845fbc4f286a1081694d77dec56f -
Branch / Tag:
refs/tags/cvfile-haystack/v0.1.0 - Owner: https://github.com/cvfile
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-cvfile-haystack.yml@ef9680eda343845fbc4f286a1081694d77dec56f -
Trigger Event:
push
-
Statement type: