Skip to main content

A library that allows communication via the Signal IM service using the signald daemon.

Project description

pysignald

pipeline status

pysignald is a Python client for the excellent signald project, which in turn is a command-line client for the Signal messaging service.

pysignald allows you to programmatically send and receive messages to Signal.

Installation

You can install pysignald with pip:

$ pip install pysignald

Running

Just make sure you have signald installed. Here's an example of how to use pysignald:

from signald import Signal

s = Signal("+1234567890")

# If you haven't registered/verified signald, do that first:
s.register(voice=False)
s.verify("sms code")

s.send_message("+1098765432", "Hello there!")

for message in s.receive_messages():
    print(message)

You can also use the chat decorator interface:

from signald import Signal

s = Signal("+1234567890")

@s.chat_handler("hello")  # This is case-insensitive.
def hello(message, match):
    return "Hello there!"


@s.chat_handler(re.compile("my name is (.*)"))  # This is case-sensitive.
def name(message, match):
    return "Hello %s." % match.group(1)


s.run_chat()

Various

pysignald also supports different socket paths:

s = Signal("+1234567890", socket_path="/var/some/other/socket.sock")

It supports TCP sockets too, if you run a proxy. For example, you can proxy signald's UNIX socket over TCP with socat:

$ socat -d -d TCP4-LISTEN:15432,fork UNIX-CONNECT:/var/run/signald/signald.sock

Then in pysignald:

s = Signal("+1234567890", socket_path=("your.serveri.ip", 15432))

Project details


Download files

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

Source Distribution

pysignald-0.0.4.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

pysignald-0.0.4-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file pysignald-0.0.4.tar.gz.

File metadata

  • Download URL: pysignald-0.0.4.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.10 CPython/3.6.3 Linux/4.15.0-42-generic

File hashes

Hashes for pysignald-0.0.4.tar.gz
Algorithm Hash digest
SHA256 662424f1998af83ec0057b8d045c74cef4e7b506f7731c0b400aec48977e8944
MD5 52a6861fd7d779685c44065c396907e8
BLAKE2b-256 331de9096b7ea508c26393b16422cca8e10adb59a2d3ee4cf58d906d55975b96

See more details on using hashes here.

File details

Details for the file pysignald-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: pysignald-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.10 CPython/3.6.3 Linux/4.15.0-42-generic

File hashes

Hashes for pysignald-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 aeaead36a9b971e021a31a5960d8d54989f77e9ab989d58d4775e6543e6cf5a6
MD5 916564ffe6bd03353334bc4ba31072b4
BLAKE2b-256 b4fda6104a0b02a8423e737ff527b19843ee9a0583e902f412e9f3a1d1f08385

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page