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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyschlage-2026.8.0.tar.gz (98.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyschlage-2026.8.0-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file pyschlage-2026.8.0.tar.gz.

File metadata

  • Download URL: pyschlage-2026.8.0.tar.gz
  • Upload date:
  • Size: 98.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pyschlage-2026.8.0.tar.gz
Algorithm Hash digest
SHA256 a70f929d6ba2910080c586625a2048573d3bb9bfe7df35d106f24151d1315a61
MD5 a178d6f102e8bcfbf185a636006a1960
BLAKE2b-256 e4c6efadd7b20bc4be2cabe9f1cdc9421dacf6d83da1d81244ee1ed8df2220db

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyschlage-2026.8.0.tar.gz:

Publisher: publish-python.yml on dknowles2/pyschlage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyschlage-2026.8.0-py3-none-any.whl.

File metadata

  • Download URL: pyschlage-2026.8.0-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pyschlage-2026.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c7146bc437848c63a0f579415a52902ce3506f2226f9f89cebc660e5829f16e
MD5 dd707b9fef003adc16e78b7368dfd282
BLAKE2b-256 2339eb53e8c9c0178403f73b9bc6bbbac438025bf626a179b3471f980d9d55f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyschlage-2026.8.0-py3-none-any.whl:

Publisher: publish-python.yml on dknowles2/pyschlage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

2026.8.0 This release

2 files

2026.7.0

2 files

2026.5.0

2 files

2025.9.0

2 files

2025.7.3

2 files

2025.7.2

2 files

2025.7.1

2 files

2025.7.0

2 files

2025.4.0

2 files

2024.11.0

2 files

2024.8.0

2 files

2024.6.0

2 files

2024.2.0

2 files

2023.12.1

2 files

2023.12.0

2 files

2023.11.0

2 files

2023.10.0

2 files

2023.9.1

2 files

2023.9.0

2 files

2023.8.1

2 files

2023.8.0

2 files

2023.7.0

2 files

2023.6.0

2 files

2023.5.0

2 files

2023.4.2

2 files

2023.4.1

2 files

2023.4.0

2 files

2023.3.2

2 files

2023.3.1

2 files

2023.2.2

2 files

2023.2.1

2 files

2022.12.24

2 files

2022.12.21

2 files

2022.12.13

2 files

2022.12.3

2 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