Skip to main content

iil-ingest

Reusable Document Ingestion Package for the IIL Platform — ADR-170

Pattern: iil-enrichment (ADR-169) — Pure Python Core, Protocol-based, optional Django integration

Installation

pip install iil-ingest[pdf]        # PDF only
pip install iil-ingest[all]        # PDF + Excel + DOCX
pip install iil-ingest[all,django] # + Django mixins

Quick Start

from ingest import IngestPipeline, ProfileClassifier
from ingest.extractors.pdf import PDFExtractor
from ingest.profiles.german_hr import GERMAN_HR_PROFILES

pipeline = IngestPipeline(
    extractors=[PDFExtractor()],
    classifier=ProfileClassifier(GERMAN_HR_PROFILES),
)

with open("rechnung.pdf", "rb") as f:
    doc = pipeline.run(f.read(), filename="rechnung.pdf")

print(doc.doc_type)    # "RECHNUNG"
print(doc.confidence)  # "HIGH"
print(doc.score)       # 42.0

Custom Profile

from dataclasses import dataclass
from ingest import IngestPipeline, ProfileClassifier
from ingest.extractors.pdf import PDFExtractor

@dataclass
class SdsProfile:
    name = "SDS"
    patterns = [
        (r"sicherheitsdatenblatt", 10),
        (r"gefahrenhinweis|h\d{3}", 8),
        (r"reach", 6),
    ]
    min_score = 10

pipeline = IngestPipeline(
    extractors=[PDFExtractor()],
    classifier=ProfileClassifier([SdsProfile()]),
)

Architecture

Upload -> iil-ingest (detect + extract + classify)
       -> iil-enrichment (optional enrichment)
       -> Django DB / Paperless (archive)

Supported Formats

Format Extra Extractor
PDF [pdf] PDFExtractor (pdfplumber)
Excel (.xlsx) [excel] ExcelExtractor (openpyxl)
CSV -- CSVExtractor (stdlib)
DOCX [docx] DOCXExtractor (python-docx)

Pipeline Flow

bytes + filename
  -> detect_mime()          # magic bytes + extension
  -> extractor.extract()    # text, tables, metadata
  -> classifier.classify()  # doc_type, confidence, score
  -> IngestedDocument

References

  • ADR-170: platform/docs/adr/ADR-170-iil-ingest-document-ingestion-package.md
  • Pattern: iil-enrichment (ADR-169)
  • Migrated from: dms-hub/apps/benefits/classifier.py, dms-hub/apps/accounting/extractor.py

Metadata

Release files for iil-ingest 0.1.0

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

Source distribution (sdist)

Source distribution for iil-ingest 0.1.0
File Size Uploaded Provenance
iil_ingest-0.1.0.tar.gz 16.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for iil-ingest 0.1.0
File Interpreter ABI Platform
iil_ingest-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 30.2 kB

Release files / iil_ingest-0.1.0.tar.gz

Download URL iil_ingest-0.1.0.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
643860ced8c12e7be52edfffb368998dc1f62f50bef15dc8f6f63defb63beecf
BLAKE2b-256 checksum
How to use checksums
6733ff5a162560d4f87cc7654ea6cfd5b989c1f5f3cd113b3e07f43e63647ec0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / iil_ingest-0.1.0-py3-none-any.whl

Download URL iil_ingest-0.1.0-py3-none-any.whl
Size 13.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
288eedf08650c0d289b7250e567ec4956457d802f66bd3cdbae0d9c9f7b3395d
BLAKE2b-256 checksum
How to use checksums
050326abce79e2840ce5cf27569627ff59fcbd9307a2ddb95d4c9b5f0c038a47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Security for iil-ingest 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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