Pyschlage
=========

Pyschlage is a Python 3 library for interacting with Schlage Encode WiFi locks.

-------------------

Basic usage
===========

.. code-block:: python

    >>> 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.
    >>> lock[0].lock()


Installation
============

Pip
---

To install pyschlage, run this command in your terminal:

.. code-block:: bash

    $ pip install pyschlage


Source code
-----------

Pyschlage is actively developed on Github, where the code is
`always available <https://github.com/dknowles2/pyschlage>`_.

You can either clone the public repository:

.. code-block:: bash

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


Or download the latest
`tarball <https://github.com/dknowles2/pyschlage/tarball/main>`_:

.. code-block:: bash

    $ 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:

.. code-block:: bash

    $ cd pyschlage
    $ python -m pip install .


API Reference
=============

.. toctree::
   :maxdepth: 2

   api
