Skip to main content

stapel-chat

CI coverage pypi downloads python license llms.txt

Conversations and messaging: direct (1:1, idempotent by participant pair), group and support threads on one model; text/system messages with a monotonic per-conversation seq, replies and opaque CDN attachment keys; per-participant read markers and unread counts; anchor-paginated history (canonical anchor=seq) and conversation lists; a support layer (unassigned queue, first-come assignment, open/pending/resolved with reopen); and an optional Channels consumer for realtime delivery with seq-replay resume.

Part of the Stapel framework — composable Django apps that deploy as a monolith or as microservices without changing module code.

Install

pip install stapel-chat

At a glance

Fact Value
Version 0.1.9
Python >=3.11 (3.11, 3.12, 3.13, 3.14)
HTTP operations 10
Config axes 3
Usage surface 11
Extension points 4
Error codes 53
Fleet dependencies stapel-auth (optional) · stapel-cdn (optional) · stapel-core

Documentation

OpenAPI · capabilities.json · llms.txt (for agents)

One model backs three kinds of thread: direct (1:1, idempotent by participant pair), group, and support (a customer↔operator thread with a queue and assignment lifecycle). Messages carry a monotonic per-conversation seq that is the canonical anchor for history pagination and the resume cursor for realtime — so nothing depends on a socket staying up.

Quick start

INSTALLED_APPS = [
    # ...
    "stapel_core.django.apps.CommonDjangoConfig",
    "stapel_core.django.users",
    "rest_framework",
    "stapel_chat",
]

# urls.py
urlpatterns = [
    path("chat/", include("stapel_chat.urls")),
]

What you get

  • ConversationsPOST /chat/api/conversations (direct / group / support); direct is get-or-create by participant pair. GET lists your conversations (anchor-paginated) with unread_count.

  • MessagesGET/POST /chat/api/conversations/{id}/messages. History is anchored on seq (newest-first, both directions). Sending allocates the next seq and emits chat.message in one transaction.

  • Read markersPOST /chat/api/conversations/{id}/read (upto_seq).

  • SupportGET /chat/api/support/queue, POST .../support/conversations/{id}/{assign,resolve,reopen}.

  • Realtime (optional)stapel_chat.consumers.ChatConsumer over Channels: hello{last_seq} → replay by seq → live delivery. Install the extra:

    pip install 'stapel-chat[channels]'
    

    and wire it behind stapel_core.django.jwt.channels.JWTAuthMiddlewareStack in your asgi.py.

Configuration (STAPEL_CHAT)

Key Default Meaning
CHAT_KINDS ["direct","group","support"] Enabled thread kinds (drop support to disable the operator queue)
ATTACHMENTS True Allow opaque attachment keys on messages
MAX_BODY_LENGTH 4000 Hard cap on a text body
SCOPE_PROVIDER stapel_chat.scope.DefaultScopeProvider Resolve/enforce the opaque scope_key (e.g. per workspace)

See MODULE.md for the extension seams, comm surface and anti-patterns.

License

MIT — see LICENSE.


This page is assembled by stapel-readme from docs/readme.md plus the contract artifacts in docs/. Edit the prose in docs/readme.md; the badges, facts and links above and below it are generated — do not hand-edit README.md.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stapel_chat-0.1.9.tar.gz (50.7 kB view details)

Uploaded Source

Built Distribution

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

stapel_chat-0.1.9-py3-none-any.whl (53.0 kB view details)

Uploaded Python 3

File details

Details for the file stapel_chat-0.1.9.tar.gz.

File metadata

  • Download URL: stapel_chat-0.1.9.tar.gz
  • Upload date:
  • Size: 50.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for stapel_chat-0.1.9.tar.gz
Algorithm Hash digest
SHA256 47bf8a8c192e65b06feac5ee8caa3bf687c9fef87f7605cbf3e7bd901c1ca970
MD5 bf4196a4704a7eacab82aef497a963ee
BLAKE2b-256 c9a71d006d8ad3e6e24a2c71b11ce85e9672b0dd57d95f337a7ad8584195cc03

See more details on using hashes here.

Provenance

The following attestation bundles were made for stapel_chat-0.1.9.tar.gz:

Publisher: publish.yml on usestapel/stapel-chat

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

File details

Details for the file stapel_chat-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: stapel_chat-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 53.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for stapel_chat-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 b695350808cceb0be06bab63252dec1e7f11429fe8db398fe50c91d18c195723
MD5 7ef57291cdd5d42b62c2b67e91a1f995
BLAKE2b-256 780be59974e728204711dadcb913b89efe55462c50623e945bb75dfffa4b0950

See more details on using hashes here.

Provenance

The following attestation bundles were made for stapel_chat-0.1.9-py3-none-any.whl:

Publisher: publish.yml on usestapel/stapel-chat

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

Release history Release notifications | RSS feed

0.10.0

2 files

0.9.3

2 files

0.9.2

2 files

0.9.1

2 files

0.9.0

2 files

0.8.6

2 files

0.8.5

2 files

0.8.4

2 files

0.8.3

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.4

2 files

0.7.3

2 files

0.7.2

2 files

0.7.0

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.1

2 files

0.4.0

2 files

0.3.1

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

This release

0.1.9 This release

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

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