Skip to main content

django-repaykit

Reusable Django financing, repayment schedule, statement, and settlement workflow app powered by repaykit.

repaykit is the pure Python calculation engine. django-repaykit is the reusable Django app that owns financing accounts, repayments, settlement requests, default UI, admin, permissions, selectors, exports, and service adapters. Host projects own origination workflows, approvals, tenancy, payment gateways, compliance rules, accounting, notifications, and external integrations.

The package is service-first: views, forms, admin actions, APIs, batch imports, payment gateways, and workflows should call services instead of putting business logic in forms or templates.

Installation

pip install django-repaykit

Add the app:

INSTALLED_APPS = [
    # ...
    "django_repaykit",
]

Add URLs:

from django.urls import include, path

urlpatterns = [
    path("financing/", include("django_repaykit.urls")),
]

Run migrations:

python manage.py migrate

Optional demo data:

python manage.py repaykit_seed_demo

Service-First Creation

from datetime import date
from decimal import Decimal

from django_repaykit.services import FinancingAccountService

account = FinancingAccountService().create_financing(
    user=user,
    borrower_name="Ali Bin Abu",
    principal=Decimal("10000.00"),
    annual_rate=Decimal("0.08"),
    term_value=24,
    term_unit="months",
    payment_frequency="monthly",
    repayment_method="flat_rate",
    start_date=date.today(),
    source="ao_workflow",
    external_reference="APP-000123",
)

Recording Repayment From An External System

from datetime import date
from decimal import Decimal

from django_repaykit.services import RepaymentService

RepaymentService().record_repayment(
    account=account,
    amount=Decimal("500.00"),
    paid_at=date.today(),
    source="billplz",
    external_reference="BILL-123",
    status="confirmed",
)

Gateway signature verification, idempotency policy, and webhook security belong in the host project. Once verified, call RepaymentService.

Generating Statement

from datetime import date

from django_repaykit.services import StatementService

statement = StatementService().get_statement(account, as_of=date.today())

Only confirmed repayments affect statements. Pending, failed, reversed, and cancelled repayments remain visible as repayment records but are ignored by repaykit ledger calculations.

Settlement Quote

from datetime import date

from django_repaykit.services import SettlementService

quote = SettlementService().quote_full_settlement(account=account, as_of=date.today())

Settlement payments are recorded with RepaymentService(source="settlement"); the package does not implement payment gateway settlement collection.

Template Override

DJANGO_REPAYKIT = {
    "BASE_TEMPLATE": "base.html",
}

You can also override any package template by placing a matching file under templates/django_repaykit/ in the host project.

Permission Override

DJANGO_REPAYKIT = {
    "PERMISSION_CLASS": "myapp.permissions.MyPermission",
}

The default policy is secure:

  • staff can manage all accounts
  • account owners can view their schedule and statement
  • account owners can request settlement
  • repayment recording is staff-only
  • anonymous users are denied

Service Override

DJANGO_REPAYKIT = {
    "REPAYMENT_SERVICE_CLASS": "myapp.services.MyRepaymentService",
}

Supported service settings:

  • FINANCING_ACCOUNT_SERVICE_CLASS
  • REPAYMENT_SERVICE_CLASS
  • STATEMENT_SERVICE_CLASS
  • SETTLEMENT_SERVICE_CLASS

Default Settings

DJANGO_REPAYKIT = {
    "BASE_TEMPLATE": "django_repaykit/base.html",
    "LOGIN_REQUIRED": True,
    "DEFAULT_CURRENCY": "MYR",
    "DEFAULT_REPAYMENT_METHOD": "flat_rate",
    "DEFAULT_PAYMENT_FREQUENCY": "monthly",
    "PERMISSION_CLASS": "django_repaykit.permissions.DefaultRepayKitPermission",
    "FINANCING_ACCOUNT_SERVICE_CLASS": "django_repaykit.services.FinancingAccountService",
    "REPAYMENT_SERVICE_CLASS": "django_repaykit.services.RepaymentService",
    "STATEMENT_SERVICE_CLASS": "django_repaykit.services.StatementService",
    "SETTLEMENT_SERVICE_CLASS": "django_repaykit.services.SettlementService",
    "ENABLE_SETTLEMENT_REQUESTS": True,
    "ENABLE_REPAYMENT_RECORDING": True,
}

Security Notes

Public URLs use UUIDs and never expose integer primary keys. UUID URLs are not authorization: views still enforce permissions through selectors and the permission class. Host projects must validate business rules, compliance rules, product policies, and payment gateway signatures.

Disclaimer

django-repaykit is a software integration package for repayment and financing calculations. It does not provide legal, accounting, Shariah, lending, tax, regulatory, or financial advice. Users are responsible for validating all policies and calculations for their own products, jurisdictions, and compliance requirements.

Metadata

Release files for django-repaykit 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-repaykit 0.1.0
File Size Uploaded Provenance Actions
django_repaykit-0.1.0.tar.gz 22.5 kB With provenance Details for django_repaykit-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-repaykit 0.1.0
File Interpreter ABI Platform Actions
django_repaykit-0.1.0-py3-none-any.whl Python 3 none any Details for django_repaykit-0.1.0-py3-none-any.whl

Total release size: 52.8 kB

Release files / django_repaykit-0.1.0.tar.gz

Download URL django_repaykit-0.1.0.tar.gz
Size 22.5 kB
Tags Source
SHA-256 checksum
How to use checksums
64b5b872552278fc60a6410aa58ccb9d2a98ac189d92186472252a9b1dbab2a7
BLAKE2b-256 checksum
How to use checksums
7036d949b5064669aa5c348705399d39d5c2817f052e96e6a582476b171a65c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 26, 2026.

Transparency log

Release files / django_repaykit-0.1.0-py3-none-any.whl

Download URL django_repaykit-0.1.0-py3-none-any.whl
Size 30.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1244429462d3b9baa7ece55a44b848005c73f9c0905806dc3d165e733a84468f
BLAKE2b-256 checksum
How to use checksums
f9cbf1b6291699d6d063b4540dc611e96a9e2266a7aa6dcb07172329dee88b94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 26, 2026.

Transparency log

Security for django-repaykit 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for django_repaykit-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page