Skip to main content

Xero API emulator – LocalStack extension

Project description

xero-local

A lightweight local emulator for the Xero Accounting API, designed for development and testing without hitting the real Xero service.

Can be used standalone (Python or Docker) or as a LocalStack extension that starts automatically alongside LocalStack.

Supported endpoints

Resource Operations
Contacts list, get, create, update
Invoices list, get, create, update
Payments list, get, create, delete
CreditNotes list, get, create, update
Connections list (Identity API)
OAuth2 token issue (any credentials accepted)

All data is stored in memory and reset on restart. A POST /_xero/reset endpoint is available to clear state between tests.

Quickstart

Python

pip install localstack-xero
xero-local          # starts on http://localhost:5001

Docker

docker run --rm -p 5001:5001 localstack/xero-local

Point your Xero client at http://localhost:5001 instead of https://api.xero.com.

LocalStack extension

localstack extensions install xero
localstack start

The emulator starts automatically with LocalStack and is reachable at http://xero.localhost.localstack.cloud:4566.

Set XERO_PORT (default 5001) or XERO_HOST to change the bind address.

Development

make install-dev   # install with test/lint deps
make test          # run the test suite (42 tests)
make run           # start the emulator locally
make lint          # ruff check
make format        # ruff format + autofix

Docker

make docker-build  # build image for host platform
make docker-run    # run on port 5001
make docker-buildx # build and push multi-arch (amd64 + arm64)

Configuration

Variable Default Description
XERO_PORT 5001 Port the emulator listens on
XERO_HOST 0.0.0.0 Bind address

CI

Pushes to main and semver tags (v*.*.*) trigger a GitHub Actions workflow that runs the test suite (Python 3.9 and 3.11) and builds and pushes a multi-arch image (linux/amd64, linux/arm64) to Docker Hub. Required secrets: DOCKERHUB_USERNAME, DOCKERHUB_TOKEN.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

localstack_xero-0.1.0.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

localstack_xero-0.1.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file localstack_xero-0.1.0.tar.gz.

File metadata

  • Download URL: localstack_xero-0.1.0.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for localstack_xero-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a30fc9191560a229276a3287b57c9bb87293a08d9969f1836f6c39737b7ad941
MD5 0e9331d5646e6dca913ca13f20101c6b
BLAKE2b-256 38b6df21fcf2152bda6c6fe76a470c773d249de64c3c1ee0bec1b54ea2ebd665

See more details on using hashes here.

File details

Details for the file localstack_xero-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for localstack_xero-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be02d20843becdbc342a4891916aa3c6b511f89d678e40514d196bb98fca5c72
MD5 c28eda757bf4f2d3133196e9bb5ed779
BLAKE2b-256 fbc9f4a610dcd7b59a04a73f15a812bd29f32a81503468d48e81c4ba615338ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page