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.2.tar.gz (19.8 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.2-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: localstack_xero-0.1.2.tar.gz
  • Upload date:
  • Size: 19.8 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.2.tar.gz
Algorithm Hash digest
SHA256 785effa52c3ad0773d371211cc7903fde2cadfe296a3176f9841152b841e3378
MD5 7cb70e3d95eb8542e1701c090e786407
BLAKE2b-256 cb9f4f9bc8caf353d39f377fdc86a3fd53b8bf14eee1b12ba6a6de115531c128

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for localstack_xero-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 799f528af0a31ebb64d5803a6e0bb1779ed74231c59de9414f761ecc3b47dcef
MD5 cc99c7a1cfccc8ffc3e1be6f4d60fcd5
BLAKE2b-256 8b0c73216f3fccf7c5c63290086fde33b70a84c8f354b673de625b28fd45b7b0

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