Skip to content

zzinnovate/wefact-python

Repository files navigation

WeFact Python Wrapper

PyPI version Tests codecov Python Version

An unofficial, batteries-included Python client for the WeFact API. Pragmatic, typed where it counts, and intentionally minimal on magic.

WeFact is a Dutch invoicing and accounting platform. Create invoices and quotes, process supplier invoices, and maintain real-time insight into your administration.

Built and maintained by zzinnovate. Not affiliated with WeFact.

Documentation

📖 View Full Documentation →

Complete guides and API reference:

For the upstream API, see the official WeFact API documentation.

Requirements

  • Python 3.11+

Install

# Basic installation (library only)
pip install wefact-python

# With CLI testing tool
pip install "wefact-python[cli]"

# For development (includes CLI, testing, and docs)
pip install -e ".[all]"

Quick start

import os
from wefact import WeFact

client = WeFact(api_key=os.getenv('WEFACT_API_KEY'))

# List your latest invoices
result = client.invoices.list(limit=25)
print(result)

Features

  • Minimal dependencies - Only requests for HTTP calls
  • Type hints - Better IDE support and fewer runtime errors
  • Direct API mapping - Mirrors WeFact's controller/action structure
  • Error handling - Clear exceptions for common failure modes
  • Attachment support - Base64 encoding/decoding utilities built-in
  • Production-tested - Used by zzinnovate in client projects

Resources

Complete coverage of all 13 WeFact API resources:

Invoices • Credit Invoices • Debtors • Products • Creditors • Groups • Subscriptions • Quotes • Interactions • Tasks • Transactions • Cost Categories • Settings

Common operations

# Show a debtor
debtor = client.debtors.show(Identifier=5)

# Create an invoice
invoice = client.invoices.create(
    DebtorCode="DB10000",
    InvoiceLines=[
        {
            "Number": 1,
            "ProductCode": "P0001",
            "Description": "Service",
            "PriceExcl": 100
        }
    ],
)

# Mark invoice as paid
client.invoices.mark_as_paid(Identifier=invoice["invoice"]["Identifier"])

Contributing

Contributions are welcome. See CONTRIBUTING.md for development setup, testing, and workflow guidelines.

Security

See SECURITY.md for reporting vulnerabilities and best practices.

Credits

License

MIT. See LICENSE.

About

A Python wrapper for the WeFact API

Resources

License

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages