Skip to main content

PDFxact

A powerful PDF Quiz Generator that extracts content from PDFs and automatically generates educational questions with fact checking capabilities.

Installation

pip install pdfxact

Features

  • PDF text extraction with OCR support
  • AI-powered question generation from PDF content
  • Automated fact checking and validation
  • Text preprocessing and quality analysis
  • Batch processing for efficient question generation
  • Customizable number of questions

Usage

Command Line Interface

# Generate 5 questions from a PDF file
qz path/to/your/document.pdf

# Generate a specific number of questions
qz path/to/your/document.pdf --num_questions 10

# Control batch processing size
qz path/to/your/document.pdf --num_questions 20 --batch_size 8

Python API

from qz.text_extractor import TextExtractor
from qz.question_generator import QuestionGenerator

# Extract text from PDF
extractor = TextExtractor()
text = extractor.extract_text_from_pdf("path/to/your/document.pdf")

# Generate quiz questions
generator = QuestionGenerator()
questions = generator.generate_question_from_text(text, num_questions=5)

# Process the questions
for i, question in enumerate(questions, 1):
    print(f"Question {i}: {question['text']}")
    print("Options:", question['options'])
    print("Correct Answer:", question['options'][question['correct_answer']])
    print()

Advanced Features

  • OCR Support: Automatically extracts text from scanned PDFs using EasyOCR
  • Fact Checking: Validates generated questions against source content
  • Quality Analysis: Ensures generated questions meet educational standards
  • Batch Processing: Efficiently processes multiple questions in parallel

Requirements

  • Python 3.11
  • Dependencies (automatically installed):
    • torch: Deep learning support
    • spacy: NLP processing
    • transformers: Question generation
    • pypdf: PDF processing
    • easyocr: OCR support
    • reportlab: PDF generation
    • ollama: LLM integration

See pyproject.toml for full dependency list.

Development

  1. Clone the repository
  2. Install development dependencies:
    pip install -r requirements-dev.txt
    
  3. Install pre-commit hooks:
    pre-commit install
    
  4. Run tests:
    pytest
    

License

MIT License - See LICENSE file for details

Metadata

Release files for pdfxact 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pdfxact 0.1.2
File Size Uploaded
pdfxact-0.1.2.tar.gz 15.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pdfxact 0.1.2
File Interpreter ABI Platform
pdfxact-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 29.0 kB

Release files / pdfxact-0.1.2.tar.gz

Download URL pdfxact-0.1.2.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c013801b15cb0216b9d90b33887f87cf7f8aeb2654c94ad0bcfe6209c2facaaa
BLAKE2b-256 checksum
How to use checksums
0b2d866417e8678e967ce9d83355bb33566069da0523c127a7f658b99df0d445
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Release files / pdfxact-0.1.2-py3-none-any.whl

Download URL pdfxact-0.1.2-py3-none-any.whl
Size 14.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ad6aee4da5b2ff51438b329faeb52659311fcb5eb5d80939759511ac1f12029a
BLAKE2b-256 checksum
How to use checksums
7ba9989ec6b2f21456a7b204d5c613b590ac1c47d5a4692132c0b76d65443d9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

1 release file

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page