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.1.1.tar.gz (19.4 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.1.1-py3-none-any.whl (25.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for iil_doc_templates-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d0c3faae2158b58d4638e8e7ea8d300fd4678a65d87e37331a7dde7ca8901ac7
MD5 8546a740791e59a8fc1d93d557bf4009
BLAKE2b-256 1808e3dbe062d805228c30eba316109bb6cd3e6155a9045a9f7ecd7a508ea102

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for iil_doc_templates-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b47dcd7a76830665d877da5b7ba63c5dedf81f2b91623f9b9e95c4686e101766
MD5 a3aa795b5e85d80e3607983a811c085e
BLAKE2b-256 6201be4d62ebc166c3a6c208d3465169c095ff944358e0bcae96fb85d493e042

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