Skip to main content

Loqed Touch Smart Lock — Python client

This repository provides a small async-first Python client for the Loqed Touch smart lock. It wraps the HTTP API used by Loqed devices and exposes convenient helpers to read lock state, send lock/unlock commands, and manage webhooks.

Quick start

  1. Install the package (recommended: in a virtualenv):

Using uv (recommended):

uv venv
uv pip install -e .

Using pip:

python -m venv .venv
source .venv/bin/activate
pip install -e .
  1. Install dev/test dependencies (optional):
uv pip install -e ".[dev]"

or with pip:

pip install -e ".[dev]"

Note: quote .[dev] (as above) — in zsh, an unquoted .[dev] is interpreted as a glob pattern and fails with no matches found: .[dev].

  1. Use the client (async):
import asyncio
from loqedAPI.loqed import APIClient, LoqedAPI

async def main():
	client = APIClient(base_url="https://api.loqed.com", token="your-api-token")
	api = LoqedAPI(client)

	# fetch a lock by id
	lock = await api.async_get_lock("lock-id")
	print("state:", lock.bolt_state)

	# send an unlock command
	await lock.unlock()

asyncio.run(main())

Notes:

  • The library is async-first and uses aiohttp for HTTP calls.
  • APIClient accepts base_url and an optional token (for authorization) or you can provide your own aiohttp.ClientSession.

Testing

Run the test suite with pytest (the project uses pytest-asyncio and aioresponses).

With uv (no need to activate the venv or pre-install anything — uv run syncs the dev extra into an ephemeral environment automatically):

uv run --extra dev pytest --cov=src/loqedAPI --cov-report=term-missing

With pip/a manually activated venv:

source .venv/bin/activate
pytest --cov=src/loqedAPI --cov-report=term-missing

Development

  • The package follows standard Python packaging with pyproject.toml (version is derived from git tags via setuptools-scm).
  • Dev/test dependencies are available under the dev extra: uv pip install -e ".[dev]" or pip install -e ".[dev]".
  • When editing code, run the tests frequently. The tests are fast and designed to mock network calls.

Contributing

If you want to contribute:

  1. Fork the repo, create a branch, and make your changes.
  2. Add or update tests for new behavior.
  3. Run the test suite and ensure all tests pass.
  4. Open a pull request with a short description of the change.

Releasing

Releases are built and published to PyPI automatically by a public GitHub Actions workflow (.github/workflows/release.yml) — there is no manual/local publish step.

To cut a release:

  1. Draft a GitHub Release with a tag in the form vX.Y.Z (e.g. v2.1.12).
  2. Publish the release. The package version is derived from the tag via setuptools-scm, so the version on PyPI always matches a tagged commit in this repository.
  3. CI runs the test suite, builds the sdist/wheel, and publishes to PyPI using PyPI Trusted Publishing (no stored API tokens).

Where to find docs

  • Source code is under src/loqedAPI.
  • Sphinx documentation lives in docs/.

License

See the LICENSE file in the project root.

Metadata

Release files for loqedAPI 2.1.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for loqedAPI 2.1.14
File Size Uploaded
loqedapi-2.1.14.tar.gz 157.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for loqedAPI 2.1.14
File Interpreter ABI Platform
loqedapi-2.1.14-py3-none-any.whl Python 3 none any Details

Total release size: 168.1 kB

Release files / loqedapi-2.1.14.tar.gz

Download URL loqedapi-2.1.14.tar.gz
Size 157.0 kB
Tags Source
SHA-256 checksum
How to use checksums
aca4d524412009e054da8a59fc5707f6a48d766435432d4ff13efba84e94d606
BLAKE2b-256 checksum
How to use checksums
73a4be465f6a2589ce6cc2b1080ed79da8bf0a548ae40aa9e9c9609ade8fa628
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / loqedapi-2.1.14-py3-none-any.whl

Download URL loqedapi-2.1.14-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ba91f7850f052ecb11c4a1fcbe8733d4a5c3e06c1f4be8b0385af4c30fb9081
BLAKE2b-256 checksum
How to use checksums
16df6d101131451679ec4f2d5d116e8c12a403ee55b1e5f8c8b7c82f3e2b02ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release history Release notifications | RSS feed

2.1.18

2 release files

2.1.16

2 release files

2.1.15

2 release files

This release

2.1.14 This release

2 release files

2.1.11

1 release file

2.1.10

1 release file

2.1.9

1 release file

2.1.8

1 release file

2.1.7

1 release file

2.1.6

1 release file

2.1.5

1 release file

2.1.4

1 release file

2.1.3

1 release file

2.1.2

1 release file

2.1.1

1 release file

2.0.12

1 release file

2.0.11

1 release file

2.0.9

1 release file

2.0.8

1 release file

2.0.7

1 release file

2.0.6

1 release file

2.0.5

1 release file

2.0.4

1 release file

2.0.3

1 release file

2.0.2

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page