Install
openclaw skills install tyche-proTyche Pro â Invoice & Fortune Engine. Generate professional PDF-ready invoices, track multi-currency payments, apply tax and late fee calculations, send tiered reminder emails, and export a full revenue analytics dashboard â all from a CSV. The full-power version of Tyche.
openclaw skills install tyche-proEverything in Tyche, plus multi-currency support, revenue goal tracking, project code grouping, aged receivables report, and CSV export of all analytics.
| Feature | Tyche (Free) | Tyche Pro |
|---|---|---|
| Invoices | Unlimited | Unlimited |
| Late fee calc | â | â + per-invoice override |
| Reminder tiers | 3 tiers | 3 tiers + escalation log |
| Multi-currency | â | â Per-invoice currency |
| Project grouping | â | â Group by project_code |
| Revenue goal | â | â Progress bar |
| Aged receivables | â | â 30/60/90 day buckets |
| Analytics export | â | â Full CSV dashboard |
ð Get Tyche Pro: openclaw skills install tyche-pro + key at ko-fi.com/occupythemilkyway
All data stays on your machine. No transmission, no cloud.
pip3 install rich --break-system-packages --quiet
import os, csv, re, json
from datetime import datetime, timedelta
from collections import defaultdict
from rich.console import Console
from rich.table import Table
from rich.panel import Panel
from rich.progress import Progress, BarColumn, TextColumn
from rich import box
console = Console()
import hashlib as _hashlib
_KEY_HASHES = {
"6b47cbf0e0ff707aa0dded96233b690b25a0772fa9851046496672d5b5cbd94a", # Tyche Pro individual
"33bc286313f89bd8a1cc3f07c470c244c346594f941d33bccddb89b566ca8a3a", # Bundle (all 5 Pro skills)
}
LICENSE_KEY = os.environ.get("LICENSE_KEY", "").strip()
if _hashlib.sha256(LICENSE_KEY.encode()).hexdigest() not in _KEY_HASHES:
console.print(Panel(
"[red bold]ð Tyche Pro requires a valid license key.[/red bold]
"
"Get your key at: [bold cyan]ko-fi.com/occupythemilkyway[/bold cyan]
"
"Or use the free version: [dim]openclaw skills install tyche[/dim]",
title="License Required", border_style="red"
))
raise SystemExit(1)
INVOICES_FILE = os.environ.get("INVOICES_FILE", "").strip()
YOUR_NAME = os.environ.get("YOUR_NAME", "Your Company")
YOUR_EMAIL = os.environ.get("YOUR_EMAIL", "")
YOUR_ADDRES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]
[[Ý[JKYWÙ]HËÙ]
YWÙ]HKÝ]\ÈËÙ]
Ý]\È[ZYKÝÙ\
KÝ\[ÞH[ØÝ\Þ[H[ÜÞ[KÚXÝØÛÙHËÙ]
ÚXÝØÛÙHK\\
HÜÑSTSJB[ÙNÛÛÛÛK[
ÞY[Ý×x¡.{î#ÈÈSÒPÑT×ÑSH8 %\Ú[È[[È]KËÞY[Ý×WB[ÚXÙ\ÈHÂÈ[Û[X\SLHÛY[Û[YHXÛYHÛÜÛY[Ù[XZ[[[ÐXÛYKÛÛH\ØÜ\[ÛÙXÚ]HY\ÚYÛ[[Ý[LYWÙ]HÝË][YY[J^\ÏLMJJKÝ[YJVKI[KIYKÝ]\ÈÝ\YHÝ\[ÞHTÑÞ[HÚXÝØÛÙHÑPKÈ[Û[X\SLÛY[Û[YHÛØ^[ÈÛY[Ù[XZ[\ÛØ^ÛÛH\ØÜ\[ÛÛÛÝ[[È]Z[\[[Ý[NYWÙ]HÝÊÝ[YY[J^\ÏLL
JKÝ[YJVKI[KIYKÝ]\È[ZYÝ\[ÞHTÑÞ[HÚXÝØÛÙHÓÓÕSKÈ[Û[X\SLÈÛY[Û[YH[]XÚÛY[Ù[XZ[^P[]XÚÛÛH\ØÜ\[ÛÙÛÈ\ÚYÛ[[Ý[ÍLYWÙ]HÝË][YY[J^\ÏMJJKÝ[YJVKI[KIYKÝ]\ÈZYÝ\[ÞHÐÞ[H°¨ÈÚXÝØÛÙHTÒQÓKÈ[Û[X\SL
ÛY[Û[YH[X[HÛÈÛY[Ù[XZ[[[ÙP[X[KÛÈ\ØÜ\[ÛÑSÈ]Y][[Ý[LYWÙ]HÝË][YY[J^\ÏLÍJJKÝ[YJVKI[KIYKÝ]\ÈÝ\YHÝ\[ÞHTÑÞ[HÚXÝØÛÙHPTÑUSÈKÈ[Û[X\SL
HÛY[Û[YHÛÞ[[ÛÜÛY[Ù[XZ[\ÛÞ[[ÛÛH\ØÜ\[Û\V\ÚYÛ[[Ý[ÍYWÙ]HÝÊÝ[YY[J^\ÏL
JKÝ[YJVKI[KIYKÝ]\È[ZYÝ\[ÞHUTÞ[H¸ «ÚXÝØÛÙHTÒQÓKÈ[Û[X\SL
ÛY[Û[YHXÛYHÛÜÛY[Ù[XZ[[[ÐXÛYKÛÛH\ØÜ\[Û[ÛHÝ\Ü[[Ý[LYWÙ]HÝË][YY[J^\ÏMJKÝ[YJVKI[KIYKÝ]\ÈÝ\YHÝ\[ÞHTÑÞ[HÚXÝØÛÙHÕTÔKBÈ[XÚÜ[[[ÚXÙ\ÎÝXH[È[[Ý[B^HÝX
VÔUHÈL[ÈÝXÝ[HHÝX[È^HH^[ÈÝ[HHÝX
È^YHH\ÙWÙ]J[ÈYWÙ]HJB[ÈYWÙHHYB[È^\×Û]HHHX^
ÝÈHYJK^\ÊHYYH[[ÈÝ]\ÈH[
Ý\YH[ZYH[ÙH[È]WÙYHHH[ÈÝ[H
UWÑQWÔUHÈL
[È^\×Û]HHÈÌ
HY[È^\×Û]HH[UWÑQWÔUH[ÙHÈ[[ÚX[È
TÑY\]Z][[Ý[ÈÜÝ[[X\JBÝ[Ú[ÚXÙYHÝ[JVÈÝ[HÜH[[ÚXÙ\ÊBÝ[ÜZYHÝ[JVÈÝ[HÜH[[ÚXÙ\ÈYVÈÝ]\ÈH == "paid")
total_outstanding = total_invoiced - total_paid
overdue_invoices = [i for i in invoices if i["days_late"] > 0]
total_late_fees = sum(i["late_fee"] for i in invoices)
# Header
console.print()
console.print(Panel.fit(
f"[bold yellow]âï¸ð Tyche Pro â Revenue Dashboard[/bold yellow]\n"
f"Invoiced: [white]{fmt(total_invoiced)}[/white] Received: [green]{fmt(total_paid)}[/green] "
f"Outstanding: [red]{fmt(total_outstanding)}[/red] Late fees: [orange3]{fmt(total_late_fees)}[/orange3]",
border_style="yellow"
))
# Revenue goal progress
if REVENUE_GOAL > 0:
pct = min(total_paid / REVENUE_GOAL * 100, 100)
bar = "â" * int(pct / 5) + "â" * (20 - int(pct / 5))
console.print(Panel(
f"[cyan]{bar}[/cyan] [yellow]{pct:.1f}%[/yellow] {fmt(total_paid)} / {fmt(REVENUE_GOAL)} goal",
title="Revenue Goal", border_style="green"
))
# Status table
console.print()
tbl = Table(title="Invoice Status", box=box.ROUNDED, border_style="yellow")
tbl.add_column("Inv #", width=10, style="dim")
tbl.add_column("Project", width=10, style="magenta")
tbl.add_column("Client", width=16, style="cyan")
tbl.add_column("Cur", width=5)
tbl.add_column("Total", width=12, justify="right")
tbl.add_column("Due", width=12, style="dim")
tbl.add_column("Late", width=8, justify="right", style="red")
tbl.add_column("Fee", width=10, justify="right", style="orange3")
tbl.add_column("Status", width=10)
SC = {"paid":"green","unpaid":"yellow","overdue":"red","partial":"cyan"}
for inv in sorted(invoices, key=lambda x: -(x["days_late"] or 0)):
sc = SC.get(inv["status"],"white")
late = f"{inv['days_late']}d" if inv["days_late"] else "â"
fee = fmt(inv["late_fee"], inv["sym"]) if inv["late_fee"] else "â"
tbl.add_row(
inv["inv_number"], inv["project_code"], inv["client_name"][:14],
inv["currency"], fmt(inv["total"], inv["sym"]), inv["due_date"],
late, fee, f"[{sc}]{inv['status'].title()}[/{sc}]"
)
console.print(tbl)
# Pro: Aged receivables (30/60/90+ day buckets)
console.print()
buckets = {"Current (0-30d)": [], "31-60 days": [], "61-90 days": [], "90+ days": []}
for inv in overdue_invoices:
d = inv["days_late"]
if d <= 30: buckets["Current (0-30d)"].append(inv)
elif d <= 60: buckets["31-60 days"].append(inv)
elif d <= 90: buckets["61-90 days"].append(inv)
else: buckets["90+ days"].append(inv)
aged_tbl = Table(title="Aged Receivables", box=box.SIMPLE, border_style="red")
aged_tbl.add_column("Bucket", style="cyan", width=18)
aged_tbl.add_column("Count", width=8, justify="right")
aged_tbl.add_column("Amount", width=14, justify="right", style="red")
for bucket, invs in buckets.items():
total = sum(i["total"] for i in invs)
aged_tbl.add_row(bucket, str(len(invs)), fmt(total) if invs else "â")
console.print(aged_tbl)
# Pro: Project grouping
console.print()
proj_totals = defaultdict(lambda: {"invoiced":0,"paid":0,"outstanding":0,"count":0})
for inv in invoices:
p = inv["project_code"]
proj_totals[p]["invoiced"] += inv["total"]
proj_totals[p]["count"] += 1
if inv["status"] == "paid":
proj_totals[p]["paid"] += inv["total"]
else:
proj_totals[p]["outstanding"] += inv["total"]
proj_tbl = Table(title="Revenue by Project", box=box.SIMPLE, border_style="magenta")
proj_tbl.add_column("Project", style="magenta", width=14)
proj_tbl.add_column("Invoices", width=10, justify="right")
proj_tbl.add_column("Invoiced", width=14, justify="right")
proj_tbl.add_column("Paid", width=14, justify="right", style="green")
proj_tbl.add_column("Outstanding", width=14, justify="right", style="red")
for proj, data in sorted(proj_totals.items(), key=lambda x: -x[1]["invoiced"]):
proj_tbl.add_row(proj, str(data["count"]), fmt(data["invoiced"]),
fmt(data["paid"]), fmt(data["outstanding"]))
console.print(proj_tbl)
# Reminder emails
overdue_remind = [i for i in invoices if i["days_late"] > 0]
if overdue_remind:
console.print()
for inv in overdue_remind:
late_line = f" A late fee of {fmt(inv['late_fee'], inv['sym'])} has accrued." if inv["late_fee"] else ""
if inv["days_late"] <= 7:
tier, colour = "Friendly Reminder", "yellow"
body = f"Invoice {inv['inv_number']} for {fmt(inv['total'], inv['sym'])} was due {inv['due_date']}.{late_line} If you've sent payment, please disregard."
elif inv["days_late"] <= 21:
tier, colour = "Firm Reminder", "orange3"
body = f"Invoice {inv['inv_number']} for {fmt(inv['total'], inv['sym'])} is now {inv['days_late']} days overdue.{late_line} Please arrange payment or contact me to discuss."
else:
tier, colour = "FINAL NOTICE", "red"
body = f"FINAL NOTICE: Invoice {inv['inv_number']} for {fmt(inv['total'], inv['sym'])} is {inv['days_late']} days overdue.{late_line} Please remit within 48 hours or contact me immediately."
console.print(Panel(
f"To: {inv['client_email']}\nSubject: {tier} â {inv['inv_number']} â {inv['client_name']}\n\nDear {inv['client_name']},\n\n{body}\n\nKind regards,\n{YOUR_NAME}",
title=f"[{colour}]{tier}[/{colour}] â {inv['client_name']} ({inv['days_late']}d overdue)",
border_style=colour
))
# Save outputs
date_str = now.strftime("%Y-%m-%d")
report_file = f"tyche_pro_report_{date_str}.md"
csv_file = f"tyche_pro_analytics_{date_str}.csv"
with open(report_file, "w", encoding="utf-8") as f:
f.write(f"# âï¸ð Tyche Pro Report â {date_str}\n\n")
f.write(f"**Invoiced:** {fmt(total_invoiced)} **Received:** {fmt(total_paid)} **Outstanding:** {fmt(total_outstanding)}\n\n")
f.write("## Invoice Status\n\n| Inv # | Project | Client | Total | Due | Days Late | Status |\n|---|---|---|---|---|---|---|\n")
for inv in sorted(invoices, key=lambda x: -(x["days_late"] or 0)):
f.write(f"| {inv['inv_number']} | {inv['project_code']} | {inv['client_name']} | {fmt(inv['total'],inv['sym'])} | {inv['due_date']} | {inv['days_late'] or 'â'} | {inv['status'].title()} |\n")
with open(csv_file, "w", newline="", encoding="utf-8") as f:
writer = csv.writer(f)
writer.writerow(["inv_number","client","project","currency","total","days_late","late_fee","status"])
for inv in invoices:
writer.writerow([inv["inv_number"],inv["client_name"],inv["project_code"],inv["currency"],
f"{inv['total']:.2f}",inv["days_late"],f"{inv['late_fee']:.2f}",inv["status"]])
console.print()
console.print(Panel(
f"[green]â
Done![/green] [cyan]{report_file}[/cyan] | [cyan]{csv_file}[/cyan]",
border_style="green"
))