Skip to main content

Reusable Django document template system — create, edit, fill templates with PDF extraction and LLM prefill

Project description

iil-doc-templates

Reusable Django document template system — create, edit, fill templates with PDF extraction and LLM prefill.

Installation

pip install iil-doc-templates

With optional dependencies:

pip install iil-doc-templates[pdf]   # pdfplumber for PDF extraction
pip install iil-doc-templates[llm]   # iil-aifw for LLM prefill
pip install iil-doc-templates[all]   # everything

Quick Start

# settings.py
INSTALLED_APPS = [
    ...
    "doc_templates",
]

# urls.py
path("doc-templates/", include("doc_templates.urls")),

Then run migrations:

python manage.py migrate doc_templates

Features

  • DocumentTemplate — Reusable document templates with JSON structure (sections + fields)
  • DocumentInstance — Filled-out documents based on templates
  • PDF Upload — Extract structure from PDF using iil-concept-templates
  • Interactive Editor — Drag & drop sections, CRUD fields, table columns
  • LLM Prefill — AI-powered field completion via iil-aifw
  • PDF Export — Generate PDF from filled documents via concept_templates.document_renderer
  • Multi-Tenant — All queries filter by tenant_id

Architecture

iil-concept-templates (Pure Python)      iil-doc-templates (Django)
├── Pydantic Schemas                     ├── Django Models
├── PDF Structure Extraction     ──►     ├── CRUD Views + URLs
├── Analysis, Prefill, Export            ├── HTML Templates (6)
└── No Django dependency                 ├── Admin Integration
                                         └── Uses concept_templates internally

Field Types

Type Description
textarea Multi-line text (default)
text Single-line text
number Numeric input
date Date picker
boolean Yes/No toggle
table Table with configurable columns

URL Patterns

URL View Description
/ template-list List all templates + instances
/create/ template-create Create empty template
/upload/ template-upload Create template from PDF
/<pk>/edit/ template-edit Interactive template editor
/<pk>/delete/ template-delete Delete template
/<pk>/instance/create/ instance-create Create document from template
/instance/<pk>/edit/ instance-edit Edit document fields
/instance/<pk>/delete/ instance-delete Delete document
/instance/<pk>/prefill/ instance-prefill LLM prefill endpoint
/instance/<pk>/pdf/ instance-pdf PDF export

Dependencies

  • Required: Django ≥ 4.2, iil-concept-templates ≥ 0.4.0
  • Optional: pdfplumber (PDF extraction), iil-aifw (LLM prefill)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iil_doc_templates-0.2.0.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iil_doc_templates-0.2.0-py3-none-any.whl (27.0 kB view details)

Uploaded Python 3

File details

Details for the file iil_doc_templates-0.2.0.tar.gz.

File metadata

  • Download URL: iil_doc_templates-0.2.0.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for iil_doc_templates-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fffd1e8affae31d216b23acb02cc77d4b700695c7fb832f8582a3777f5142339
MD5 7713618c63c98ddfb45ceb98d7c79641
BLAKE2b-256 7f80fcae1b5e067bfc0ff111b553639effdee459ebf7341450137e3cd31634e5

See more details on using hashes here.

File details

Details for the file iil_doc_templates-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for iil_doc_templates-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a7b29dd511e3636d44bfc7e68842beaf10752cfd2f8728f0aff6caf5fe1e0ad7
MD5 e6be2b8f8de797efe84aa4b89e0172e5
BLAKE2b-256 23b14760b6902cb9e6325d108a7142806f08e3e964b3a432d0b9d4986fb9cc88

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page