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 projectPOST /peepstick/tickets— submits a ticket, validated and routed to Slack server-side. Accepts either:- a JSON body:
{"fields": {...}} - a
multipart/form-databody (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.
- a JSON body:
Add or rename fields in the PeepsTick dashboard and /peepstick/form-schema
updates automatically — no code changes or redeploys needed.
Django setup
-
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"
-
In your project's
urls.py:from django.urls import include, path urlpatterns = [ ..., path("tickets/", include("peepstick.django.urls")), ]
-
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).
Two-way tickets (0.4.0+)
With the project's secret key (sk_..., generated on the PeepsTick
project page — keep it on your server), your backend can show users their
tickets, let them correct them, and follow up:
from peepstick import PeepsTickClient, PeepsTickError, verify_webhook
client = PeepsTickClient(api_key=settings.PEEPSTICK_SECRET_KEY, base_url=settings.PEEPSTICK_BASE_URL)
reporter = {"id": str(user.id), "email": user.email, "name": user.get_full_name(),
"orgId": str(department.id), "orgName": department.name}
client.submit_ticket(fields, files=files, reporter=reporter,
labels=["Current", "Expected"], context={"page": "/intake", "role": "clerk"})
client.list_tickets(reporter, scope="team", status=["submitted", "in_progress"], q="intake")
client.get_ticket(reporter, 42) # ticket, comments, history, permissions
client.update_ticket(reporter, 42, fields={"title": "Intake page won't save"}) # until triaged
client.add_comment(reporter, 42, "Still happening", files=[("now.png", data, "image/png")])
client.transition(reporter, 42, "reopen", comment="Broken again on Firefox")
client.find_similar(reporter, "intake page")
content, content_type, filename = client.get_attachment(reporter, 42, attachment_id)
Errors raise PeepsTickError with .status_code (404 not visible to this
reporter, 409 edit after work started, ...). verify_webhook(raw_body,
signature, timestamp, secret) checks PeepsTick webhook deliveries.
Metadata
Release files for peepstick 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| peepstick-0.4.1.tar.gz | 12.1 kB | Without provenance | Details for peepstick-0.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| peepstick-0.4.1-py3-none-any.whl | Python 3 | none | any | Details for peepstick-0.4.1-py3-none-any.whl |
Total release size: 24.1 kB
Release files / peepstick-0.4.1.tar.gz
| Download URL | peepstick-0.4.1.tar.gz |
|---|---|
| Size | 12.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3b54fc4035dc474ea2e641741b13aebaf84fe7a599eb9297e6c926e36f1d3d3b
|
|
BLAKE2b-256 checksum How to use checksums |
63937d83dc62013d6e0c74e8f631d3259943fad0a579157df873fd01ee98bad6
|
| 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.4.1-py3-none-any.whl
| Download URL | peepstick-0.4.1-py3-none-any.whl |
|---|---|
| Size | 12.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e2dbc957ae313e3c283ec8db0c91bd93b0f33e18654f1e0747aa6080fcadd604
|
|
BLAKE2b-256 checksum How to use checksums |
bc2a65b2342ec1bbf51f74a526f1389200bf12b8d9a0c12987094fb1bb273a8e
|
| 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.4.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.
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.