Skip to main content

peepstick

Drop this into a Python app to get ticket routing that goes straight to your team's Slack channel — configured entirely from the PeepsTick dashboard.

This package never talks to Slack. It only ever calls your PeepsTick project's API (/api/form-schema, /api/tickets). PeepsTick owns the Slack webhook and does the actual posting server-side.

Install

# FastAPI apps
pip install "peepstick[fastapi]"

# Django apps
pip install "peepstick[django]"

FastAPI setup

from fastapi import FastAPI
from peepstick.fastapi import create_ticket_router

app = FastAPI()
app.include_router(
    create_ticket_router(
        api_key="tk_...",             # from your project's page in the PeepsTick dashboard
        base_url="https://peepstick.yourcompany.com",
    ),
    prefix="/peepstick",
)

This gives your app two routes your frontend can call — the API key never reaches the browser:

  • GET /peepstick/form-schema — the live fields configured for your project
  • POST /peepstick/tickets — submits a ticket, validated and routed to Slack server-side. Accepts either:
    • a JSON body: {"fields": {...}}
    • a multipart/form-data body (send each field as its own form value, plus one or more files under any file-type field's id) — use this when the project's form schema includes an attachment field. PeepsTick enforces the limits (10MB per file, 20MB total) and rejects anything over.

Add or rename fields in the PeepsTick dashboard and /peepstick/form-schema updates automatically — no code changes or redeploys needed.

Django setup

  1. In settings.py, add the app and your project's credentials (find the API key on your project's page in the PeepsTick dashboard):

    INSTALLED_APPS = [
        ...,
        "peepstick.django",
    ]
    
    PEEPSTICK_API_KEY = "tk_..."
    PEEPSTICK_BASE_URL = "https://peepstick.yourcompany.com"
    
  2. In your project's urls.py:

    from django.urls import include, path
    
    urlpatterns = [
        ...,
        path("tickets/", include("peepstick.django.urls")),
    ]
    
  3. Visit /tickets/. The form renders whatever fields are configured for your project in the PeepsTick dashboard — add or rename fields there and the form updates automatically, no code changes needed. A file-type field renders as <input type="file" multiple>, so visitors can attach more than one file per submission.

Using the client directly

If you'd rather build your own view or call PeepsTick from a script:

from peepstick import PeepsTickClient

client = PeepsTickClient(api_key="tk_...", base_url="https://peepstick.yourcompany.com")

fields = client.get_form_schema()
ticket = client.submit_ticket({"title": "Login broken", "priority": "High"})

# With file attachments -- `files` maps a field id to a LIST of
# (filename, content_bytes, content_type) tuples, any number per field:
with open("screenshot.png", "rb") as f:
    ticket = client.submit_ticket(
        {"title": "Login broken", "priority": "High"},
        files={"attachment": [("screenshot.png", f.read(), "image/png")]},
    )

Both methods raise peepstick.PeepsTickError on failure (network issues, invalid API key, missing required fields, etc).

Metadata

Release files for peepstick 0.3.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 peepstick 0.3.0
File Size Uploaded Provenance Actions
peepstick-0.3.0.tar.gz 8.5 kB Without provenance Details for peepstick-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for peepstick 0.3.0
File Interpreter ABI Platform Actions
peepstick-0.3.0-py3-none-any.whl Python 3 none any Details for peepstick-0.3.0-py3-none-any.whl

Total release size: 17.5 kB

Release files / peepstick-0.3.0.tar.gz

Download URL peepstick-0.3.0.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
dfb2126f2536f4fc55b60c545c33998a98a1b2cca9e3d783fd977ebd6eddeaf5
BLAKE2b-256 checksum
How to use checksums
268c2789a56a59a561a4db6eab3b48d2dab6d45e9d6ab1be7d43e5d89454d995
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / peepstick-0.3.0-py3-none-any.whl

Download URL peepstick-0.3.0-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
565e159b346559f084a996088a74347af5f917e8ed39ab7c317a6845d37d62eb
BLAKE2b-256 checksum
How to use checksums
440536ca988110f347bb0782603642b77c629b89067bc0f0c8fc682884191183
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for peepstick 0.3.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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