Skip to main content

scixtract

Python PyPI version License: GPL v3 Tests

AI-powered PDF text extraction for scientific papers. Removes artifacts, preserves formatting like chemical formulas and citations.

Usage

# First run creates directory structure
scixtract extract

# Put PDFs in pdf/ directory
# Run extraction
scixtract extract

# Clean markdown files appear in md/ directory

Output: Markdown files with page numbers preserved and extraction artifacts removed.

Directory structure:

your-project/sources/
├── pdf/         # Input PDFs
├── md/          # Output markdown
└── working/     # Intermediate files

What it does

For each PDF, scixtract:

  1. Extracts text from PDF using unstructured library
  2. Processes each page with AI (qwen3:8b via Ollama):
    • Removes spacing artifacts and broken words
    • Fixes line breaks and hyphenation
    • Preserves chemical formulas (H₂O, CO₂)
    • Preserves citations and references
    • Maintains paragraph structure
  3. Extracts metadata: Title, authors, keywords
  4. Generates summary of the document
  5. Outputs:
    • md/filename.md - Clean markdown with page markers
    • working/filename_ai_extraction.json - Structured data
    • working/filename_ai_processed.md - Full processed text

Page numbers are preserved as [Page X] markers in the markdown.

Prerequisites

Before using scixtract, you need to install and set up Ollama:

1. Install Ollama

macOS:

brew install ollama

Linux:

curl -fsSL https://ollama.ai/install.sh | sh

Windows: Download from ollama.ai

2. Start Ollama service

ollama serve

3. Install a model

For scientific PDFs:

# Default model (4.7GB)
ollama pull qwen3:8b

Installation

pip install scixtract

Single file processing

# Extract a single PDF to custom location
scixtract extract paper.pdf

# Specify output directory
scixtract extract paper.pdf --output-dir results/

Python API

from scixtract import AdvancedPDFProcessor
from pathlib import Path

# Initialize processor
processor = AdvancedPDFProcessor(
    model="qwen3:8b"
)

# Process PDF
result = processor.process_pdf(Path("paper.pdf"))

# Access cleaned text
print(f"Title: {result.metadata.title}")
print(f"Authors: {', '.join(result.metadata.authors)}")

# Get page content
for page in result.pages:
    print(f"Page {page.page_number}: {page.content[:200]}...")

Text cleanup utility

Removes hyphenation artifacts and reflows paragraphs:

scixtract text-fix extracted.txt --output cleaned.txt
cat messy.txt | scixtract text-fix - > clean.txt

Knowledge management

# Extract and index
scixtract extract paper.pdf --bib-file references.bib --update-knowledge

# Search
scixtract knowledge --search "catalysis"
scixtract knowledge --stats

Output

  • Markdown: Clean text with page numbers preserved
  • JSON: Structured data with metadata and keywords
  • SQLite database: Searchable index across documents

System requirements

  • Python: 3.10 or higher
  • Memory: 8GB RAM minimum (16GB+ recommended for large models)
  • Storage: 20GB+ free space for AI models
  • Ollama: Required for AI processing

Help and setup

Use the built-in setup helper:

# Check if Ollama is properly configured
scixtract-setup-ollama --check-only

# List available models
scixtract-setup-ollama --list-models

# Complete setup with default model
scixtract-setup-ollama --model qwen3:8b

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE.txt file for details.

Support

For technical documentation, API reference, and development information, see MAINTAINER_README.md.

For issues and questions, please visit the GitHub repository.


Built with Windsurf.

Metadata

Release files for scixtract 1.1.1

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

Source distribution (sdist)

Source distribution for scixtract 1.1.1
File Size Uploaded Provenance
scixtract-1.1.1.tar.gz 29.1 kB With provenance Details

Built distribution (wheel)

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

Total release size: 59.5 kB

Release files / scixtract-1.1.1.tar.gz

Download URL scixtract-1.1.1.tar.gz
Size 29.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e7ec4a72c34e42d773a4ccfe614c307019148bfbde568426ca317dc736456b0c
BLAKE2b-256 checksum
How to use checksums
532d002c77c547a8d639dff1e40de885b0e21f7c7fa3bfd4a0702b8d6c38cad2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 18, 2026.

Transparency log

Release files / scixtract-1.1.1-py3-none-any.whl

Download URL scixtract-1.1.1-py3-none-any.whl
Size 30.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
40a6819a28c66a600f1236432b73b8fa488e11ce4d0e74e71d923850cfd2ba83
BLAKE2b-256 checksum
How to use checksums
61e9b8288d12bea75d8462449f65932b7ff43080a5399d24544031868fee2da7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 18, 2026.

Transparency log

Security for scixtract 1.1.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for scixtract-1.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 18, 2026.

Transparency log

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.

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