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.0.tar.gz (18.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.1.0-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: iil_doc_templates-0.1.0.tar.gz
  • Upload date:
  • Size: 18.7 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.0.tar.gz
Algorithm Hash digest
SHA256 98e0c7fc9575e9f4c7854a60b7d0495b708ad822cce99c165c5ab6f76d804128
MD5 74219a3b95da0ce3a41b5f72abd5b5f3
BLAKE2b-256 5100a4f74bc83cd0eced1d38bb17ae03675e9200d37c5c9b04b1364985ef873b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for iil_doc_templates-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 62aa365c6b71f0c22275469424247f938334acf5232dcb75c4bdd7a0d9b08690
MD5 6696a46d2121bb8267f576e34882d13e
BLAKE2b-256 85b1fc5c184a7c09662ab5d71201455d0e61d60d6d685fbaf6ca86382a261029

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