SevDesk Python client
  • Python 99.7%
  • Just 0.3%
Find a file
2026-03-31 05:33:20 +02:00
.forgejo/workflows Rename to sevdesk-py, move source to src/ layout 2026-03-30 11:45:10 +02:00
.pi/skills/the-loop docs(skill): add action endpoint coverage to the-loop skill 2026-03-31 02:19:42 +02:00
docs docs: add API reference, trim platform design to current state 2026-03-31 01:19:12 +02:00
examples Initial commit: sevdeskpy typed SDK 2026-03-30 11:26:59 +02:00
iterations Initial commit: sevdeskpy typed SDK 2026-03-30 11:26:59 +02:00
scripts release: v0.3.0 — Contact Address & Communication Way CRUD 2026-03-31 00:21:50 +02:00
src/sevdeskpy fix: sort imports in __init__.py (lint fix for v0.5.4) 2026-03-31 05:33:20 +02:00
tests fix: get_pdf returns raw bytes via _request_raw instead of JSON parsing 2026-03-31 02:06:52 +02:00
.env.example Initial commit: sevdeskpy typed SDK 2026-03-30 11:26:59 +02:00
.gitignore Initial commit: sevdeskpy typed SDK 2026-03-30 11:26:59 +02:00
CHANGELOG.md docs: add v0.5.4 changelog entry 2026-03-31 05:31:27 +02:00
CLAUDE.md Rename to sevdesk-py, move source to src/ layout 2026-03-30 11:45:10 +02:00
INSTRUCTIONS.md release: v0.3.0 — Contact Address & Communication Way CRUD 2026-03-31 00:21:50 +02:00
justfile Add newsletter-driven maintenance workflow 2026-03-30 11:30:53 +02:00
LICENSE Initial commit: sevdeskpy typed SDK 2026-03-30 11:26:59 +02:00
openapi.yaml Initial commit: sevdeskpy typed SDK 2026-03-30 11:26:59 +02:00
pyproject.toml feat: document ISO 8601 recurring intervals, export RECURRING_INTERVALS (v0.5.4) 2026-03-31 05:27:54 +02:00
README.md feat: invoice lifecycle methods + 100% coverage 2026-03-30 23:54:17 +02:00
USAGE.md feat: invoice lifecycle methods + 100% coverage 2026-03-30 23:54:17 +02:00

sevdeskpy

Test

A Python SDK for the sevdesk API.

Quick Start

Prerequisites

  • Python 3.11+
  • A sevdesk account with API token

Setup

git clone https://git.miskam.xyz/mxm/sevdeskpy.git
cd sevdeskpy
python -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -e ".[dev]"
cp .env.example .env
# Add your sevdesk API token to .env

Run an iteration manually

# Generate types for a specific endpoint group
python scripts/generate.py --group contacts

# Validate generated types against live API
python scripts/validate.py

# Run both in sequence
python scripts/generate.py --group contacts && python scripts/validate.py

Run with Claude

Open this repo with a code agent at it, then say:

Read INSTRUCTIONS.md. Generate wrappers for all remaining endpoint groups. For each one, validate and update instructions. Keep going until all pass.

Project Structure

.
├── INSTRUCTIONS.md              ← The self-improving brain (START HERE)
├── CLAUDE.md                    ← Context file for Claude Code
├── src/
│   └── sevdeskpy/
│       ├── __init__.py          ← Public API exports
│       ├── client.py            ← Base SevdeskClient class
│       ├── exceptions.py        ← Typed error classes
│       ├── types/
│       │   ├── common.py        ← Shared models (pagination, refs, errors)
│       │   ├── contact.py
│       │   ├── invoice.py
│       │   └── ...
│       └── endpoints/
│           ├── contacts.py
│           ├── invoices.py
│           └── ...
├── scripts/
│   ├── generate.py              ← Type generation from live API
│   ├── validate.py              ← Live API validation
│   └── iterate.py               ← Prompt templates for Claude
├── tests/
├── iterations/                  ← Logs from each iteration
│   ├── iteration-001.log
│   └── samples/                 ← Raw API response snapshots
├── pyproject.toml
└── .env.example

Usage

from sevdeskpy import SevdeskClient

client = SevdeskClient(api_token="your_token")

# List contacts
contacts = client.contacts.list(limit=10)
for c in contacts:
    print(c.name, c.customer_number)

# Get a single invoice
invoice = client.invoices.get("12345")
print(invoice.invoiceNumber, invoice.status)

# Create an invoice with positions
result = client.invoices.create_via_factory(
    invoice={...},
    invoice_pos_save=[{...}],
)

# Full invoice lifecycle
client.invoices.render("12345")           # Generate PDF
pdf = client.invoices.get_pdf("12345")     # Download PDF bytes
client.invoices.send_via_email("12345",    # Send via email
    to_email="kunde@example.com",
    subject="Rechnung", text="Anbei.",
)
client.invoices.book_amount("12345",       # Book payment
    amount=1190.0, date="2026-03-30",
    check_account_id="77",
)
client.invoices.cancel("12345")            # Create cancellation invoice
client.invoices.enshrine("12345")          # Lock permanently

Contributing

The best way to contribute is to run iterations and submit PRs that include both the improved generated code AND the updated INSTRUCTIONS.md.

License

MIT