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.15

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.15
File Size Uploaded
loqedapi-2.1.15.tar.gz 157.0 kB Details

Built distribution (wheel)

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

Total release size: 168.2 kB

Release files / loqedapi-2.1.15.tar.gz

Download URL loqedapi-2.1.15.tar.gz
Size 157.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d4590ad48b08e419e36f98b9ebf70e9bb5aad87fde4d4631ca7f06b064c673eb
BLAKE2b-256 checksum
How to use checksums
5c2340b4668c634234ffea8d4b206776734ff1e8928ded96918e9f8797776637
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 28, 2026.

Transparency log

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

Download URL loqedapi-2.1.15-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0b88f1dda0a1166f4498401e4a0dee01e1d6a47d040b10c35804959ea4bf89f2
BLAKE2b-256 checksum
How to use checksums
3ce5633cb85b228a2886e3f5925a25de2be2c79de0061fba9c849179ada6d775
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 28, 2026.

Transparency log

Release history Release notifications | RSS feed

2.1.18

2 release files

2.1.16

2 release files

This release

2.1.15 This release

2 release files

2.1.14

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