Skip to main content

Document scanning and KYC face verification widgets for Django

Project description

Django Camera Kit

Document scanning and KYC face verification widgets for Django. Drop a real document scanner (live edge detection, manual corner adjustment, multi-page → PDF) into any existing FileField, no new models or endpoints required. Add live selfie/ID face verification with a server-side matching endpoint.

Tests PyPI version License

Documentation | PyPI | Source

Status

Document scanning (this package's base install) and KYC identity verification (the kyc extra) are both implemented and tested. See the documentation for the full guide, including the KYC module's security model and known MVP limitations.

Quick example

# forms.py — any existing ModelForm, any existing FileField/ImageField
from django import forms
from django_camera_kit.widgets import DocumentScannerWidget

from .models import Contract


class ContractForm(forms.ModelForm):
    class Meta:
        model = Contract
        fields = ["signed_document"]
        widgets = {"signed_document": DocumentScannerWidget()}
<!-- template -->
{{ form.media }}
<form method="post" enctype="multipart/form-data">
  {% csrf_token %}
  {{ form }}
  <button type="submit">Enregistrer</button>
</form>

The widget replaces the plain file input with a "Scanner un document" button. Clicking it opens the camera, detects the document's edges live (OpenCV.js), lets the user drag the corners if detection misses, and supports adding several pages before assembling everything into a single PDF — written back into the same file input via the DataTransfer API. From the form's point of view, it's a normal file upload.

KYC quick example

pip install django-camera-kit[kyc]
# forms.py
from django import forms
from django_camera_kit.kyc.widgets import KYCVerificationWidget

class SignupForm(forms.Form):
    kyc_verification_id = forms.IntegerField(
        widget=KYCVerificationWidget(verify_url="/kyc/verify/")
    )

Requires PostgreSQL with the pgvector extension. Matching (face embeddings via YuNet + insightface) only ever happens server-side. See KYC & Identity Verification for the full setup and security model.

Setup

Two vendor JS files are required for the scan widget and not committed to this repo (binary build artifacts, pinned separately) — see django_camera_kit/static/django_camera_kit/vendor/README.md for exact files and versions to download.

Requires Bootstrap (or Bootstrap Native) CSS/JS to already be loaded on the host page for button styling — django-camera-kit only ships the structural/positioning CSS for the scanner overlays themselves.

Roadmap

  1. Scan MVP — single page, manual corner adjustment, perspective warp
  2. Auto contour detection refinements
  3. Multi-page flow polish
  4. KYC MVP — selfie + ID capture, embedding comparison, head-movement liveness challenge
  5. Anti-deepfake hardening — server-verified liveness, passive scoring, multiple challenge types
  6. Docs site + PyPI release

License

MIT

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

django_camera_kit-0.1.0.tar.gz (4.1 MB view details)

Uploaded Source

Built Distribution

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

django_camera_kit-0.1.0-py3-none-any.whl (4.1 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_camera_kit-0.1.0.tar.gz
  • Upload date:
  • Size: 4.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for django_camera_kit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 846bc9eb92e9f046f7f7e9bccc01c1d05fb1a9fe569e29cbe4fd0c6362d73faf
MD5 f1ae4f97662fcebbf85b1654e7dd0d92
BLAKE2b-256 991238fa8cd365be64e8a5ddf60ca561a6e6ffc271a78c4bc5dd17bd47e8345a

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_camera_kit-0.1.0.tar.gz:

Publisher: publish.yml on Altius-Academy-SNC/django-camera-kit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for django_camera_kit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e6adf24c06d41d44ac7fd9a0cd9848b8cc666cf6453df951a70729b14632f84a
MD5 5d445fba8e60b85bd0003f88050ffc69
BLAKE2b-256 046ae55834f4792e6b70cd6053345003e13fb079d464093dd6219f9a7cc90451

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_camera_kit-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Altius-Academy-SNC/django-camera-kit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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