xero-python
Official Python sdk for Xero API generated by OpenAPI spec for oAuth2
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-pythonuv
uv add xero-pythonpoetry
poetry add xero-pythonInstalling 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
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
pyxeroPyXero is a Python client library for the Xero…
permissive · top 15,000 on PyPI
Unified-python-sdkPython SDK client for the Unified.to API,…
unclear · top 15,000 on PyPI
python-quickbooksA Python library for querying, creating,…
permissive · top 5,000 on PyPI
python-upwork-oauth2Python bindings for the Upwork API using OAuth…
permissive · top 15,000 on PyPI
intuit-oauthProvides OAuth2 and OpenID Connect…
permissive · top 5,000 on PyPI
longbridgeLongbridge provides a Python SDK for accessing…
unclear · top 15,000 on PyPI
oauth2-clientHandles OAuth2 authentication flows…
unclear · top 15,000 on PyPI
edx-rest-api-clientProvides OAuth2 and JWT utilities for…
permissive · top 15,000 on PyPI
requests-oauthlibAdds OAuth 1 and OAuth 2 authentication support…
permissive · top 1,000 on PyPI
Salesforce-FuelSDKProvides Python bindings to Salesforce…
permissive · top 15,000 on PyPI