Skip to main content

tungsten-leads

Leads plugin for Tungsten, the admin panel for FastAPI.

What you get

  • Leads list with stages (New, Contacted, Qualified, Proposal sent, Won, Lost), source, owner, deal value and next follow-up.
  • Tabs for My leads, Follow-up due, New and Won; filters; search; export to CSV or Excel.
  • Bulk actions: assign to a user, mark won, mark lost, delete.
  • A timeline on each lead for notes, calls, emails and messages.
  • Lead fields: admins add their own form fields (text, number, date, dropdown, checkboxes, yes/no...) from the panel, without code. Values are saved on the lead.
  • Dashboard numbers: total, new this week, follow-ups due, won and win rate.
  • Optional website form API: POST leads to <panel>/api/leads.

Install

pip install tungsten-leads
from tungsten_leads import LeadsPlugin

panel.plugin(LeadsPlugin())
panel.create_tables(engine)   # creates the leads tables too

Options

LeadsPlugin(
    statuses={"new": ("New", "info"), "demo": ("Demo booked", "primary"), "won": ("Won", "success"), "lost": ("Lost", "danger")},
    sources={"manual": "Added by hand", "website": "Website", "walk_in": "Walk-in"},
    capture_token="long-random-text",   # turns on the website form API
    dashboard_widget=True,
)

Website form API

curl -X POST https://admin.example.com/admin/api/leads \
  -H "X-Leads-Token: long-random-text" -H "Content-Type: application/json" \
  -d '{"name": "Amit", "phone": "+91 98765 43210", "city": "Pune"}'

name, email, phone, company and notes go to the lead itself. Any other key is saved in the lead's extra fields.

Use it from your code or other plugins

from tungsten_leads import add_activity, create_lead, find_lead, on_lead_created

lead = create_lead(db, name="Amit", phone="+919876543210", source="meta", external_id="meta-lead-id")
add_activity(db, lead, "Asked about the MBA course", type="call")
db.commit()

@on_lead_created
def welcome(db, lead):
    ...  # send a WhatsApp message, an email...

create_lead skips a lead whose external_id is already saved, so the same Meta lead is never added twice.

Hooks for other plugins

leads = panel.get_plugin("leads")
leads.on_lead_created("my-plugin.welcome", lambda db, lead: ...)   # only this panel's leads
leads.add_lead_action(lambda: Action("quote").label("Send quote").action(...))   # a button on every lead
leads.add_lead_bulk_action(lambda: BulkAction("tag").label("Tag").action(...))   # a bulk action

Metadata

Release files for tungsten-leads 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 tungsten-leads 0.1.0
File Size Uploaded
tungsten_leads-0.1.0.tar.gz 13.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tungsten-leads 0.1.0
File Interpreter ABI Platform
tungsten_leads-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 27.6 kB

Release files / tungsten_leads-0.1.0.tar.gz

Download URL tungsten_leads-0.1.0.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b5b803427dda1e1128cd2e7ce3cc6754ea8227aaec34e72641a8d20b0bd77667
BLAKE2b-256 checksum
How to use checksums
610c98f6e04e35c24f58762f56385891166990f9a1d356bdb9279c984ed51ab4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

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

Download URL tungsten_leads-0.1.0-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f787978fe879eda306f48d5d4c6d7c3de06e4c408364dcf78633ceb0acb764ba
BLAKE2b-256 checksum
How to use checksums
970788b2c80682bd5d2aae8ffa5c97e6810775878aab5ad8ae97e55c92530a7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release history Release notifications | RSS feed

0.1.2

2 release files

0.1.1

2 release files

This release

0.1.0 This release

2 release 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