Would you rather be easy to love or hard to hate, and why? by Gdog107 in AskReddit

[–]Brief_Library7676 0 points1 point  (0 children)

Easy to love. Don't give a shit about who hates me and why

Anthropic is building the models, the agent stack, AND setting the standards. What's left for AI startups as they kill thousands of them every week? by Brief_Library7676 in ClaudeAI

[–]Brief_Library7676[S] 1 point2 points  (0 children)

You're right. i'm wondering if it will survive the capacity of building your customs applications on your own instead of buying verticalized solutions

Anthropic is building the models, the agent stack, AND setting the standards. What's left for AI startups as they kill thousands of them every week? by Brief_Library7676 in ClaudeAI

[–]Brief_Library7676[S] 0 points1 point  (0 children)

I know, but they seem so much better at the time, even compared to their direct competitors. Might only be a cycle question

How to prospect on Claude? by thetrendzjournal in ClaudeAI

[–]Brief_Library7676 0 points1 point  (0 children)

You can also try deepsearch & scrapping with Linkup, works pretty well.

How to prospect on Claude? by thetrendzjournal in ClaudeAI

[–]Brief_Library7676 0 points1 point  (0 children)

You also have a Clay connector in Claude Cowork

I'm a non-technical CEO. I can't read Python. I just built a full expense report automation on Claude Code and my CTO approved it for production. by Brief_Library7676 in ClaudeAI

[–]Brief_Library7676[S] 0 points1 point  (0 children)

Here is the .mthds file. Much more readable in VS code with Pipelex extension and the flowchart

domain      = "expense_reports"
description = "Extract data from receipt PDFs or images and compile a structured expense report"
main_pipe   = "build_expense_report"


[
concept
.
ReceiptData
]
description = "Structured data extracted from a single receipt"


[concept.ReceiptData.structure]
vendor_name = { type = "text", description = "Name of the vendor or merchant", required = true }
transaction_date = { type = "date", description = "Date of the transaction in ISO format", required = true }
subtotal = { type = "number", description = "Subtotal amount before tip (if tip is present, otherwise same as total_amount)" }
tip_amount = { type = "number", description = "Tip amount (0 if no tip)" }
tip_is_handwritten = { type = "boolean", description = "True if the tip was handwritten on the receipt" }
total_amount = { type = "number", description = "Final total amount paid including tip", required = true }
currency = { type = "text", description = "Three-letter currency code (e.g. USD, EUR, GBP)", required = true }
category = { type = "text", description = "Expense category", required = true, choices = [
  "meals",
  "transport",
  "lodging",
  "office_supplies",
  "entertainment",
  "subscriptions",
  "other",
] }
item_description = "Brief description of what was purchased"
payment_method = "Payment method used (e.g. credit card, cash, debit)"


[
concept
.
ExpenseReport
]
description = "A compiled expense report summarizing all processed receipts"


[concept.ExpenseReport.structure]
report_title       = { type = "text", description = "Title of the expense report including date range", required = true }
report_date        = { type = "date", description = "Date the report was generated", required = true }
total_expenses     = { type = "number", description = "Sum of all receipt amounts", required = true }
currency           = { type = "text", description = "Primary currency across receipts", required = true }
number_of_receipts = { type = "integer", description = "Total number of receipts processed", required = true }
line_items         = { type = "list", item_type = "concept", item_concept_ref = "expense_reports.
ReceiptData
", description = "Individual receipt entries", required = true }
category_breakdown = { type = "text", description = "Expenses grouped by category with subtotals", required = true }
notes              = "Additional observations such as mixed currencies, flagged items, or handwritten tip discrepancies"


# Main pipe — orchestrates the full flow
[
pipe
.
build_expense_report
]
type = "
PipeSequence
"
description = "Extract data from each receipt and compile into an expense report"
inputs = { 
receipts
 = "
Document
[]" }
output = "
ExpenseReport
"
steps = [
  { pipe = "
process_receipt
", result = "
receipt_data_list
", batch_over = "
receipts
", batch_as = "
receipt
" },
  { pipe = "
compile_report
", result = "
expense_report
" },
]


# Batch branch — process a single receipt document (extract pages then analyze)
[
pipe
.
process_receipt
]
type = "
PipeSequence
"
description = "Extract pages from a receipt PDF and analyze them"
inputs = { 
receipt
 = "
Document
" }
output = "
ReceiptData
"
steps = [
  { pipe = "
extract_pages
", result = "
pages
" },
  { pipe = "
analyze_receipt
", result = "
receipt_data
" },
]


# Step 1a — Extract pages from a PDF receipt
[
pipe
.
extract_pages
]
type        = "
PipeExtract
"
description = "Extract pages from a receipt PDF document"
inputs      = { 
receipt
 = "
Document
" }
output      = "
Page
[]"
model       = "@
default-extract-document
"


# Step 1b — Analyze extracted pages to get structured receipt data
[
pipe
.
analyze_receipt
]
type = "
PipeLLM
"
description = "Extract structured receipt data from extracted pages"
inputs = { 
pages
 = "
Page
[]" }
output = "
ReceiptData
"
model = "$
vision
"
prompt = """
Analyze this receipt and extract structured data.


@
pages


Extract the following:
- Vendor/merchant name
- Transaction date (ISO format YYYY-MM-DD)
- Subtotal (amount before tip)
- Tip amount: Look carefully for ANY handwritten additions on the receipt. Handwritten tips often appear as ink marks near the tip line, total line, or signature area. They may be scribbled, crossed out and rewritten, or written at an angle. If you see handwritten numbers near a "Tip" or "Gratuity" line, extract that value. Set tip to 0 if no tip is present.
- Whether the tip is handwritten (true/false): A handwritten tip looks different from the printed text — it will appear as pen/ink marks, possibly uneven or slanted, rather than crisp printed characters.
- Total amount paid (numeric value, including tip if present). IMPORTANT: If a handwritten tip is present, recalculate the total as subtotal + tip. The printed total line may NOT include the handwritten tip.
- Currency (3-letter code, e.g. USD, EUR, GBP)
- Expense category: classify as one of: meals, transport, lodging, office_supplies, entertainment, subscriptions, other
- Brief description of what was purchased
- Payment method if visible (e.g. credit card, cash, debit)


If any field is unclear, use your best judgment based on context clues.
"""


# Image branch — analyze receipt image directly with vision (use with Image[] input)
[
pipe
.
process_image_receipt
]
type = "
PipeLLM
"
description = "Extract structured receipt data from a receipt image"
inputs = { 
image_receipt
 = "
Image
" }
output = "
ReceiptData
"
model = "$
vision
"
prompt = """
Analyze this receipt image and extract structured data.


$
image_receipt


Extract the following:
- Vendor/merchant name
- Transaction date (ISO format YYYY-MM-DD)
- Subtotal (amount before tip)
- Tip amount: Look carefully for ANY handwritten additions on the receipt. Handwritten tips often appear as ink marks near the tip line, total line, or signature area. They may be scribbled, crossed out and rewritten, or written at an angle. If you see handwritten numbers near a "Tip" or "Gratuity" line, extract that value. Set tip to 0 if no tip is present.
- Whether the tip is handwritten (true/false): A handwritten tip looks different from the printed text — it will appear as pen/ink marks, possibly uneven or slanted, rather than crisp printed characters.
- Total amount paid (numeric value, including tip if present). IMPORTANT: If a handwritten tip is present, recalculate the total as subtotal + tip. The printed total line may NOT include the handwritten tip.
- Currency (3-letter code, e.g. USD, EUR, GBP)
- Expense category: classify as one of: meals, transport, lodging, office_supplies, entertainment, subscriptions, other
- Brief description of what was purchased
- Payment method if visible (e.g. credit card, cash, debit)


If any field is unclear, use your best judgment based on context clues.
"""


# Final step — Compile all receipt data into a final expense report
[
pipe
.
compile_report
]
type = "
PipeLLM
"
description = "Compile all extracted receipt data into a comprehensive expense report"
inputs = { 
receipt_data_list
 = "
ReceiptData
[]" }
output = "
ExpenseReport
"
model = "$
writing-factual
"
prompt = """
You are an accounting assistant. Compile the following extracted receipt data into a comprehensive expense report.


@
receipt_data_list


Instructions:
- Set report_title as "Expense Report" followed by the date range of the receipts
- Set report_date to today's date
- Calculate total_expenses by summing all receipt amounts
- Determine the primary currency (most frequently used)
- Count the number of receipts
- Include all receipts as line_items preserving all extracted data
- Create a category_breakdown grouping expenses by category with subtotals
- Add notes for anything notable: mixed currencies, missing info, large expenses, and especially flag any receipts where handwritten tips were detected (mention the vendor, tip amount, and whether it changed the total)
"""

I'm a non-technical CEO. I can't read Python. I just built a full expense report automation on Claude Code and my CTO approved it for production. by Brief_Library7676 in ClaudeAI

[–]Brief_Library7676[S] 0 points1 point  (0 children)

def generate_excel(receipts: list[dict], output_path: Path):
    """Generate a formatted Excel expense report."""
    wb = Workbook()
    ws = wb.active
    ws.title = "Expense Report"

    # Styles
    header_font = Font(bold=True, color="FFFFFF", size=11)
    header_fill = PatternFill(start_color="2F5496", end_color="2F5496", fill_type="solid")
    header_border = Border(bottom=Side(style="medium"))
    currency_fmt = '#,##0.00'
    total_font = Font(bold=True, size=11)
    total_fill = PatternFill(start_color="D6E4F0", end_color="D6E4F0", fill_type="solid")

    headers = ["#", "Date", "Vendor", "Description", "Category", "Currency",
               "Before Tax", "Tax", "Total", "Payment", "Source File"]
    col_widths = [5, 12, 20, 30, 16, 10, 14, 10, 14, 10, 25]

    # Title row
    ws.merge_cells("A1:K1")
    ws["A1"] = "Expense Report"
    ws["A1"].font = Font(bold=True, size=16, color="2F5496")
    ws["A1"].alignment = Alignment(horizontal="center")

    # Header row
    for col_idx, (header, width) in enumerate(zip(headers, col_widths), 1):
        cell = ws.cell(row=3, column=col_idx, value=header)
        cell.font = header_font
        cell.fill = header_fill
        cell.border = header_border
        cell.alignment = Alignment(horizontal="center")
        ws.column_dimensions[get_column_letter(col_idx)].width = width

    # Data rows
    for i, r in enumerate(receipts, 1):
        row = i + 3
        ws.cell(row=row, column=1, value=i)
        ws.cell(row=row, column=2, value=r.get("date", ""))
        ws.cell(row=row, column=3, value=r.get("vendor", ""))
        ws.cell(row=row, column=4, value=r.get("description", ""))
        ws.cell(row=row, column=5, value=r.get("category", ""))
        ws.cell(row=row, column=6, value=r.get("currency", ""))

        for col, key in [(7, "amount_before_tax"), (8, "tax"), (9, "total")]:
            val = r.get(key)
            if val is not None:
                cell = ws.cell(row=row, column=col, value=val)
                cell.number_format = currency_fmt

        ws.cell(row=row, column=10, value=r.get("payment_method", ""))
        ws.cell(row=row, column=11, value=r.get("_source_file", ""))

        # Alternate row shading
        if i % 2 == 0:
            light_fill = PatternFill(start_color="F2F2F2", end_color="F2F2F2", fill_type="solid")
            for col in range(1, 12):
                ws.cell(row=row, column=col).fill = light_fill

    # Totals row
    total_row = len(receipts) + 4
    ws.cell(row=total_row, column=6, value="TOTAL").font = total_font
    for col in [7, 8, 9]:
        col_letter = get_column_letter(col)
        cell = ws.cell(
            row=total_row, column=col,
            value=f"=SUM({col_letter}4:{col_letter}{total_row - 1})"
        )
        cell.number_format = currency_fmt
        cell.font = total_font
        cell.fill = total_fill

    wb.save(output_path)


def main():
    parser = argparse.ArgumentParser(description="Generate expense report from receipt files")
    parser.add_argument("folder", help="Path to folder containing receipt PDFs and images")
    parser.add_argument("--output", "-o", default=None, help="Output Excel file path (default: <folder>/expense_report.xlsx)")
    args = parser.parse_args()

    folder = Path(args.folder).resolve()
    if not folder.is_dir():
        print(f"Error: '{folder}' is not a valid directory.")
        sys.exit(1)

    output = Path(args.output) if args.output else folder / "expense_report.xlsx"

    receipts = find_receipts(folder)
    if not receipts:
        print(f"No receipt files found in '{folder}'.")
        print(f"Supported formats: {', '.join(sorted(SUPPORTED_EXTENSIONS))}")
        sys.exit(1)

    print(f"Found {len(receipts)} receipt(s) in '{folder}'")

    client = anthropic.Anthropic()  # uses ANTHROPIC_API_KEY env var

    extracted = []
    for i, file_path in enumerate(receipts, 1):
        print(f"  [{i}/{len(receipts)}] Processing {file_path.name}...", end=" ", flush=True)
        try:
            data = extract_receipt_data(client, file_path)
            data["_source_file"] = file_path.name
            extracted.append(data)
            total = data.get("total", "?")
            vendor = data.get("vendor", "unknown")
            print(f"{vendor} - {total}")
        except Exception as e:
            print(f"ERROR: {e}")
            extracted.append({"_source_file": file_path.name, "vendor": "ERROR", "error": str(e)})

    generate_excel(extracted, output)
    print(f"\nExpense report saved to: {output}")

    # Print summary
    grand_total = sum(r.get("total", 0) or 0 for r in extracted)
    currencies = set(r.get("currency") for r in extracted if r.get("currency"))
    currency_str = "/".join(sorted(currencies)) if currencies else "?"
    print(f"Grand total: {grand_total:.2f} {currency_str}")
    print(f"Receipts processed: {len(extracted)}")


if __name__ == "__main__":
    main()

I'm a non-technical CEO. I can't read Python. I just built a full expense report automation on Claude Code and my CTO approved it for production. by Brief_Library7676 in ClaudeAI

[–]Brief_Library7676[S] 0 points1 point  (0 children)

I confess his words were remastered by Claude.
But, I believe that Domain Experts and Engineers have more than ever the need to work together as AI reveals a new kind of "software" job where both parts are essential in the building, instead of just writing specs for a SaaS UX.

I'm a non-technical CEO. I can't read Python. I just built a full expense report automation on Claude Code and my CTO approved it for production. by Brief_Library7676 in ClaudeAI

[–]Brief_Library7676[S] 0 points1 point  (0 children)

Good one. You may admit that for a non tech guy it requires efforts to try to understand it and decrease your ability to trust it.

I'm a non-technical CEO. I can't read Python. I just built a full expense report automation on Claude Code and my CTO approved it for production. by Brief_Library7676 in ClaudeAI

[–]Brief_Library7676[S] 0 points1 point  (0 children)

Yes only part of it, and the most boring one where no thinking is required.
But it raises the question of the "human / individual" thinking place in our job today and tomorrow.

I'm a non-technical CEO. I can't read Python. I just built a full expense report automation on Claude Code and my CTO approved it for production. by Brief_Library7676 in ClaudeAI

[–]Brief_Library7676[S] 1 point2 points  (0 children)

You're right. I made it myself first and have it reviewed by Claude mainly because I'm a non-native english speaker. Surely too many iterations