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.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.10.1
File Size Uploaded Provenance Actions
pyschlage-2026.10.1.tar.gz 150.4 kB With provenance Details for pyschlage-2026.10.1.tar.gz

Built distribution (wheel)

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

Total release size: 175.4 kB

Release files / pyschlage-2026.10.1.tar.gz

Download URL pyschlage-2026.10.1.tar.gz
Size 150.4 kB
Tags Source
SHA-256 checksum
How to use checksums
58023988234ff9571928aaffcb0c7a2c7b091d94e247157ab6629f4c2ccb3466
BLAKE2b-256 checksum
How to use checksums
f85b7b9a99faa7d5f09895e8323d05703d9e0038df5b2dd5fd04f5cfdd5d3ac6
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 Oct 31, 2026.

Transparency log

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

Download URL pyschlage-2026.10.1-py3-none-any.whl
Size 25.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d4e21e887bab155d1be2b8ad5e92dfb19ef3929620cb45a8812352d751d60668
BLAKE2b-256 checksum
How to use checksums
d10b4fb38d9ba6110471511f40e68558bf4b056d55774638f226155c3be530a8
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 Oct 31, 2026.

Transparency log

Security for pyschlage 2026.10.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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pyschlage-2026.10.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 Oct 31, 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.10.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