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.1.tar.gz (21.7 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.1-py3-none-any.whl (27.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: iil_doc_templates-0.2.1.tar.gz
  • Upload date:
  • Size: 21.7 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.1.tar.gz
Algorithm Hash digest
SHA256 686b1038edee1397a5a531ce5df32f487a1c6485b9a64940623edc44195bc67f
MD5 f8ddf3536aee2b49b6f34e59680e727d
BLAKE2b-256 27302387d80dbc27defb61b0f7b3e6e888b832ac3fa2228bde90e54052268305

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for iil_doc_templates-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 27203a944b76191df55cad3168ecd6f73627e0e75e393c00b2fdb91f9dbc8387
MD5 b102561401eee854aeea5685a55d0eac
BLAKE2b-256 ccdfea8777ad92db0db50b533813e06746a425f6014e3d82b35d3d76c198e8eb

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