Skip to main content

Snarl python lib, Send SNP/3.1 messages. (Snarl)

Project description

PySnarl

PySnarl python lib, Send SNP/3.1 messages. (Snarl)

Installing

Install and update using pip:

$ pip install pysnarl

pysnarl supports Python 3 and newer

Example

use as module/lib

from pysnarl import Snarl
Snarl.send("REGISTER", 'test_app', 'TEST', icon = 'snarl.png', '127.0.0.1', 9899, verbose = True)
Snarl.send("NOTIFY", 'test_app', 'TEST', 'TEST MESSAGE', 'snarl.png', '127.0.0.1', 9899, priority = 1, verbose = True)

outputs:

[SNP/3.1 REGISTER
app-id: test_app
title: TEST
icon: snarl.png
END]
request xxx: SNP/3.1 REGISTER
app-id: test_app
title: TEST
icon: snarl.png
END

result: [SNP/3.1 SUCCESS
END]

[SNP/3.1 NOTIFY
app-id: test_app
title: TEST
text: TEST MESSAGE
icon: snarl.png
priority: 1
END]
request xxx: SNP/3.1 NOTIFY
app-id: test
title: TEST
text: TEST MESSAGE
icon: snarl.png
priority: 1
END

result: [SNP/3.1 SUCCESS
END]

or run on terminal/cmd

> snarl 127.0.0.1 9889 -a test_app -i "snarl.png" -t TEST -v -R
> snarl 127.0.0.1 9889 -a test_app -b "TEST MESSAGE" -i "snarl.png" -p 1 -t TEST -v -N
> pysnarl 127.0.0.1 9889 -a test_app -i "snarl.png" -t TEST -v -R
> pysnarl 127.0.0.1 9889 -a test_app -b "TEST MESSAGE" -i "snarl.png" -p 1 -t TEST -v -N
[SNP/3.1 NOTIFY
app-id: test_app
title: TEST
text: TEST MESSAGE
icon: snarl.png
priority: 1
END]
request xxx: SNP/3.1 NOTIFY
app-id: test_app
title: TEST
text: TEST MESSAGE
icon: snarl.png
priority: 1
END

result: [SNP/3.1 SUCCESS
END]

Tips

always register (-R) before send message

Links

Author

Hadi Cahyadi

Buy Me a Coffee Donate via Ko-fi Support me on Patreon

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

pysnarl-0.33.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

pysnarl-0.33-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file pysnarl-0.33.tar.gz.

File metadata

  • Download URL: pysnarl-0.33.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pysnarl-0.33.tar.gz
Algorithm Hash digest
SHA256 dbb93a0f0531f9779255f85da75919f6128460fe3b5f498fcfbcfe51627860f0
MD5 08db735fa5b0063e0e02c1623167d9bf
BLAKE2b-256 98267906e2ca79836b6a47af58e485067cb5cbef07fa1447bf192b977d1c08d0

See more details on using hashes here.

File details

Details for the file pysnarl-0.33-py3-none-any.whl.

File metadata

  • Download URL: pysnarl-0.33-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pysnarl-0.33-py3-none-any.whl
Algorithm Hash digest
SHA256 0eb93e2a380b42cbd0893752a6b9fc6b60aed7ce566a659a29b957cc26d59a71
MD5 c2d029968e9b61370210f36ad5166306
BLAKE2b-256 88cccb9dffeec0e50fcc9054811af6623c4e7ccfff4c08749f6b55b4d06c89f9

See more details on using hashes here.

Supported by

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