Skip to main content

django-connectors

Connect Django applications to third-party APIs, SaaS platforms, files, databases and warehouses — with pluggable authentication, dlt-powered synchronization, webhooks, and customer-configurable data projections.

Status: v0.1. The service layer is the intended integration surface. The DRF API and the provider connectors are provisional and may change.

What it does

  external system  →  Connection / Binding  →  dlt  →  landing tables
                                                            ↓
                                                       Projection
                                                            ↓
                                              your TargetDefinition + writer
                                                            ↓
                                                     your Django models

Source data lands first, in a source-shaped form, and is only then mapped into shapes your application declares. That boundary is what lets a mapping change be replayed without re-fetching from the provider, and a failed write to your models be retried without touching the provider at all.

The library never imports your models. You declare a shape and a function that persists it; it never learns what that function does.

Install

pip install django-connectors
INSTALLED_APPS = [
    "django.contrib.contenttypes",  # required: Connection.owner is a GenericForeignKey
    ...
    "django_connectors",
]

DJANGO_CONNECTORS = {
    # A SQLAlchemy DSN, NOT a Django DATABASES alias — it is reached only
    # through dlt, which makes routing an ORM model there impossible.
    # MySQL and PostgreSQL are both supported and both covered by CI.
    "LANDING_URL": "postgresql+psycopg2://user:pw@host:5432/connectors_landing",
    "SOURCES": {"rest": "django_connectors.sources.rest.RestSource"},
}

Extras: mysql, postgres, drf, celery, allauth, secrets, sql, csv, parquet, s3, gs, az, google, microsoft. Installing one never enables behaviour by itself — the corresponding source or backend must also be named in the setting.

Declare a target

In any installed app's connectors.py (auto-discovered, like admin.py):

from django_connectors import (
    DateTimeField, JSONField, StringField, TargetDefinition, register_target,
)

def event_writer(records, context):
    """Must be idempotent per identity: a failed batch retries the whole run."""
    for record in records:
        if record.operation == "delete":
            Event.objects.filter(external_id=record.identity["external_id"]).delete()
            continue
        Event.objects.update_or_create(
            team_id=context.owner_object_id,
            external_id=record.identity["external_id"],
            defaults=record.values,
        )
    return len(records)

register_target(TargetDefinition(
    key="events",
    fields={
        "external_id": StringField(required=True),
        "occurred_at": DateTimeField(required=True),
        "type": StringField(required=True),
        "payload": JSONField(),
    },
    identity_fields=("external_id",),
    identity_scope="owner",   # required: decides whether two tenants may collide
    writer=event_writer,
))

Your customers then map landed columns onto those fields declaratively — no Python — and the library validates, previews and executes the mapping.

Try it

example/ is a runnable Django project demonstrating the whole flow with no credentials required:

cd example
python manage.py migrate
python manage.py demo

Sources

Built in: memory (a test driver with injectable failure modes), rest (config-driven, over dlt.sources.rest_api), sql (warehouses and databases), filesystem (JSONL/CSV/Parquet on local disk, S3, GCS or Azure — one file, a prefix, or a recursive glob). Provider connectors for Gmail, Google Sheets, Google Drive, Microsoft/Entra files and Excel, and Salesforce ship under django_connectors.providers — see their module docstrings for what is and is not verified against a live provider.

Writing your own means subclassing SourceDefinition and returning a dlt source.

Documentation

Development

uv sync --all-extras
uv run --all-extras pytest
uv run --all-extras ruff check django_connectors/ tests/ example/
uv run --all-extras ruff format django_connectors/ tests/ example/

Test tiers: default (sqlite, no docker), minimal (no extras installed), server-backed (MySQL and PostgreSQL), and an example-project smoke test. See AGENTS.md; the server tier is not optional polish — it covers data-loss and portability failures that are invisible on sqlite.

develop is the working branch; releases flow develop → main and publish to PyPI automatically.

License

MIT — see LICENSE.

Metadata

Release files for django-connectors 0.1.1

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-connectors 0.1.1
File Size Uploaded Provenance
django_connectors-0.1.1.tar.gz 417.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for django-connectors 0.1.1
File Interpreter ABI Platform
django_connectors-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 726.2 kB

Release files / django_connectors-0.1.1.tar.gz

Download URL django_connectors-0.1.1.tar.gz
Size 417.2 kB
Tags Source
SHA-256 checksum
How to use checksums
db977c2323e5287e1e61c45e6e6c6844d5eff43ff7ccd438b548e5d5ff17f569
BLAKE2b-256 checksum
How to use checksums
373f47c8b2999252d2a041d54c4af73d1af6668a9939a7e77d73a372baa2198c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 25, 2026.

Transparency log

Release files / django_connectors-0.1.1-py3-none-any.whl

Download URL django_connectors-0.1.1-py3-none-any.whl
Size 309.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
077953e3026c4500c2f1a4bd8d6f64d717a06c95bb63843e67c074dc69ab3317
BLAKE2b-256 checksum
How to use checksums
da374e59c7be7483332cd60c2821e7d640c2378ff43ada9c88c3b108c236c332
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 25, 2026.

Transparency log

Security for django-connectors 0.1.1

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for django_connectors-0.1.1.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 Oct 25, 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.1 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