skillfed

xero-python

Official Python sdk for Xero API generated by OpenAPI spec for oAuth2

xero-python v15.1.0 326.4K downloads/30d#7,576 on PyPI
Permissive license MIT license Active released

What it is and what it does

xero-python is the official SDK for integrating Xero's cloud accounting platform with Python applications. It wraps Xero's REST APIs—Accounting, Assets, Projects, Payroll (AU/UK/NZ), and Files—into Python client classes, handling OAuth 2.0 authentication and request serialization automatically. Developers use it to build integrations that read invoices, contacts, and ledger data, or write transactions and payroll records, without manually constructing HTTP requests or managing tokens.

The SDK is generated from OpenAPI specifications and requires no runtime dependencies, but installation reports high friction. It supports Python 3.5 and later and is actively maintained. Setup involves creating a Xero developer account, registering an API application, and configuring OAuth 2.0 credentials. The package handles token persistence and refresh transparently, making it suitable for web applications (especially Flask-based ones, as shown in the documentation) and server-side integrations with small business accounting workflows.

Use it for:

  • Build a web app that syncs Xero invoices and contacts into a custom CRM or billing system.
  • Automate payroll record creation or retrieval for AU, UK, or NZ organizations using Xero Payroll.
  • Extract accounting reports and journal entries from Xero for custom financial analysis or auditing.
  • Integrate Xero file storage with document management workflows in a larger application.
  • Create a project tracking dashboard that pulls time and cost data from Xero Projects.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides Python bindings to Xero's accounting, payroll, assets, projects, and files APIs, allowing developers to read and write small business accounting data programmatically.

Yes, with conditions. The package is actively maintained, has no known vulnerabilities, and is the official Xero SDK—making it the right choice for any Xero integration in Python. However, high install friction suggests you should test installation in your target environment early. The Beta status and requirement for OAuth 2.0 setup mean it's best suited for developers comfortable with API authentication flows and Xero's platform.

Install

xero-python on PyPI

pip

pip install xero-python

uv

uv add xero-python

poetry

poetry add xero-python

Installing xero-python

Before you install

High install friction reported. Package is actively maintained (latest release 4 days ago) and supports current Python versions, but the friction signal suggests potential build or dependency resolution challenges during installation.

License in practice

MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute the package provided you include the license notice.

Quickstart

pip install xero-python

from xero_python.accounting import AccountingApi
from xero_python.api_client import ApiClient, Configuration
from xero_python.api_client.oauth2 import OAuth2Token

api_client = ApiClient(
    Configuration(
        oauth2_token=OAuth2Token(
            client_id="YOUR_CLIENT_ID",
            client_secret="YOUR_CLIENT_SECRET"
        )
    )
)
accounting_api = AccountingApi(api_client)

Requires a Xero developer account with API credentials (client ID and secret) and OAuth 2.0 token setup; API calls require valid access tokens obtained through Xero's authorization flow.

Verify before relying

  • Whether high install friction is due to compiled dependencies, large package size, or complex transitive requirements.
  • Current test coverage and stability track record beyond the 'Beta' development status classifier.
  • Performance characteristics when handling large volumes of accounting transactions or payroll records.

Package facts

License MIT license (permissive)
Python support supports the current Python release (>=3.5)
Install friction high — source build required
Runtime dependencies none
Maintenance actively maintained — 4 days since the last release
First released
Downloads 326,431/month — #7,576 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: xero_python-15.1.0.tar.gz

Keywords: xero, python, sdk, API, oAuth

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8

Tags

xero api python sdkaccounting api client pythonxero oauth2 integrationsmall business accounting pythonxero invoices contacts pythonpayroll api pythonxero financial data access
accounting-apioauth2small-business

More WWW/HTTP packages