Skip to main content

pyschlage

Python 3 library for interacting with Schlage Encode WiFi locks.

Note that this project has no official relationship with Schlage or Allegion. Use at your own risk.

Usage

Basic usage

from pyschlage import Auth, Schlage

# Create a Schlage object and authenticate with your credentials.
s = Schlage(Auth("username", "password"))

# List the locks attached to your account.
locks = s.locks()

# Print the name of the first lock
print(locks[0].name)
"My lock"

# Lock the first lock.
locks[0].lock()

Managing access codes

from pyschlage.code import AccessCode

lock = locks[0]

# Add a new access code to a lock.
guest_code = AccessCode(name="Guest", code="1234")
lock.add_access_code(guest_code)

# List the access codes currently on the lock.
lock.refresh_access_codes()
for access_code in lock.access_codes.values():
    print(access_code.name, access_code.code)

# Remove an access code from the lock.
guest_code.delete()

Reading activity logs

# Fetch the 10 most recent log entries, newest first.
for log_entry in lock.logs(limit=10, sort_desc=True):
    print(log_entry.created_at, log_entry.message)

Handling errors

All requests to the Schlage cloud service can raise pyschlage.exceptions:

from pyschlage.exceptions import NotAuthorizedError, UnknownError

try:
    locks = s.locks()
except NotAuthorizedError:
    print("Invalid username or password.")
except UnknownError as ex:
    print(f"Something went wrong: {ex}")

Installation

Pip

To install pyschlage, run this command in your terminal:

$ pip install pyschlage

Source code

Pyschlage is actively developed on Github, where the code is always available.

You can either clone the public repository:

$ git clone https://github.com/dknowles2/pyschlage

Or download the latest tarball:

$ curl -OL https://github.com/dknowles2/pyschlage/tarball/main

Once you have a copy of the source, you can embed it in your own Python package, or install it into your site-packages easily:

$ cd pyschlage
$ python -m pip install .

Documentation

API reference can be found on Read the Docs

Metadata

Release files for pyschlage 2026.10.0

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

Source distribution (sdist)

Source distribution for pyschlage 2026.10.0
File Size Uploaded
pyschlage-2026.10.0.tar.gz 136.5 kB Details

Built distribution (wheel)

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

Total release size: 160.9 kB

Release files / pyschlage-2026.10.0.tar.gz

Download URL pyschlage-2026.10.0.tar.gz
Size 136.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b001c4c2202e3a66fd2b63ba98b7aaf4bc0c6435e8509145e6fe0c4c720cc245
BLAKE2b-256 checksum
How to use checksums
23af4265366dbab09c2bba871457b0d72db8bc132356b3c81a0efa88a3c763ec
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 Oct 10, 2026.

Transparency log

Release files / pyschlage-2026.10.0-py3-none-any.whl

Download URL pyschlage-2026.10.0-py3-none-any.whl
Size 24.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
90e70e5808bd463f932e848c5957b21f73f27a01d520cabf07859d82b733d661
BLAKE2b-256 checksum
How to use checksums
2a03f36490f0983520cf47e6412c00a8f25bfdcaa085f8bd6ffd43311ebd0541
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 Oct 10, 2026.

Transparency log

Release history Release notifications | RSS feed

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