RAGGen - RAG Dataset Generator
A universal tool for converting files into high-quality RAG datasets.
Features
- Supports a variety of commonly used formats for storing textual data.
- Robust PDF parsing with OCR utilizing marker library.
- Preserves headers, supports fixing header levels using LLM (OpenAI API).
- Respects tables, does not split them into chunks.
- Supports embedding metadata directly into chunk text.
- Supports adding custom metadata for each input.
- Multiple outputs formats including pandas DataFrames and Langchain documents.
- Checksum-based result caching.
Supported formats
Installation
pip install raggen
Usage
from raggen import RAGGen, RAGInput
# Initialize RAGGen
gen = RAGGen(cache_dir="cache")
# Define inputs
inputs = ["sample1.pdf", "sample2.html", "sample3.md"]
# Input with custom metadata
inputs.append(RAGInput(
path = "sample4.docx",
metadata = {"title": "Doc title"}
))
# Generate RAG dataset as list
data = gen(inputs, output_format="df", flatten=True)
TODO
- Save images
- Add proper documentation
- Add more usage examples
- Add txt support
- Add Power Point support
- Add Excel support
- Add support for reading files from buffer
Contribution
Feel free to fork this repo and make pull requests.
If you like my work, please, support me:
BTC: 32F3zAnQQGwZzsG7R35rPUS269Xz11cZ8B
Lisense
Free to use under Apache-2.0. See LICENSE for more information.
Metadata
Release files for raggen 0.1.13
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| raggen-0.1.13.tar.gz | 13.4 kB | Without provenance | Details for raggen-0.1.13.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| raggen-0.1.13-py3-none-any.whl | Python 3 | none | any | Details for raggen-0.1.13-py3-none-any.whl |
Total release size: 31.1 kB
Release files / raggen-0.1.13.tar.gz
| Download URL | raggen-0.1.13.tar.gz |
|---|---|
| Size | 13.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d411f29cd3fc524e50b239cdbeaaad6e63a96928f9ad5181a8068355c65206a3
|
|
BLAKE2b-256 checksum How to use checksums |
efc7b1cef6d41be2847ea61f9b2dca9f9c977972581d6c3aa9668e19ec10cc84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.16
|
Release files / raggen-0.1.13-py3-none-any.whl
| Download URL | raggen-0.1.13-py3-none-any.whl |
|---|---|
| Size | 17.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ae25c323c1ce0341e79ccd9821faf43a2e2b3fcf95b53f84dfdf9ec49b4f1bec
|
|
BLAKE2b-256 checksum How to use checksums |
a70a4a293b85dfe6d90f5f3d4730b9ab21eba32df8859a78c2db871ec994cfa7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.16
|
Security for raggen 0.1.13
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.