Metadata-Version: 2.1
Name: aiosignald
Version: 0.2
Summary: Python bindings for signald
Home-page: https://gitlab.com/nicocool84/aiosignald
Author: Nicolas Cedilnik
Author-email: nicoco@nicoco.fr
Requires-Python: >=3.7,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Description-Content-Type: text/x-rst

Signald python bindings
=======================

Most of the content here is generated by the ``generate.py`` script
that uses `<https://signald.org/protocol.json>`_.

Install
-------

``pip install aiosignald``

Have signald running. See `their docs <https://signald.org/articles/install/>`_ about it.

Usage
-----

Example: registration
*********************

.. code:: py

   import asyncio

   from aiosignald import SignaldAPI

   async def main():
       loop = asyncio.get_running_loop()
       _, signald = await loop.create_unix_connection(
           SignaldAPI, path=SIGNALD_SOCKET_PATH)
       await signald.register(username="+XXXXXX")
       # Some async code to get the SMS code
       await signald.verify(username="+XXXXXX", code=code)
       await signald.on_con_lost

   # See https://signald.org/articles/protocol/ for more info about this
   SIGNALD_SOCKET_PATH = "/var/run/signald/signald.sock"

   asyncio.run(main())

Docs are available on `readthedocs <https://aiosignald.readthedocs.org>`_.

