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

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.11.1
File Size Uploaded Provenance Actions
pyschlage-2026.11.1.tar.gz 166.6 kB With provenance Details for pyschlage-2026.11.1.tar.gz

Built distribution (wheel)

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

Total release size: 196.0 kB

Release files / pyschlage-2026.11.1.tar.gz

Download URL pyschlage-2026.11.1.tar.gz
Size 166.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e068f97ebb193dd27fa9637855c92ad5fb4bfc68c5f160134b14b41fab451a65
BLAKE2b-256 checksum
How to use checksums
89049be37e8ab6edfafa08cfe01353ad958a12173a7f033ec8ba802ad9eb81cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 25, 2026.

Transparency log

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

Download URL pyschlage-2026.11.1-py3-none-any.whl
Size 29.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
122692042f14ad66e249a14d2ce7633fe9af6918de04c7ba0796e5680a14c039
BLAKE2b-256 checksum
How to use checksums
c2676e0df37c6c88eb2de6037f48a65a2a25e6f3131800fca0e653d81c8d099e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 25, 2026.

Transparency log

Security for pyschlage 2026.11.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pyschlage-2026.11.1.tar.gz

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 Nov 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2026.11.1 This release

2 release files Full provenance

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