python-presence
A minimal implementation of a serverless XMPP client.
Installation
- Clone this repository and run
pip install .OR - Install from PyPi:
pip install python-presence
Usage (example client)
There is a minimal python script called python-presence for running
a service:
usage: python-presence [-h] [-d] [-k] [-f] [-v]
python-presence
optional arguments:
-h, --help show this help message and exit
-d, --daemon run as daemon
-k, --kill kill running instance if any before start
-f, --force force start on bogus lockfile
-v, --verbose
Default client commands
The client currently supports the following built-in trigger commands/keywords:
| Commmand | Description |
|---|---|
echo |
echo message text |
help |
print a list of commands |
hello |
print a hello message |
vars |
print variables |
ls |
list contents of download directory |
Extending the client with custom commands
A simple application of client commands is remote query of system information.
import subprocess
commands = {
'df': ClientThread.make_command(
func=staticmethod(
lambda client, _: client.send_ascii(
subprocess.check_output("df -h", shell=True).decode('utf-8'))
),
helptext='show list of processes',
),
'ps': ClientThread.make_command(
func=staticmethod(
lambda client, _: client.send_ascii(
subprocess.check_output("ps aux", shell=True).decode('utf-8'))
),
helptext='show list of processes',
),
}
System integration
misc/presence.service is a template file for configuring an Avahi
service. After copying to /etc/avahi/services the service
advertisement should immediately show up in clients on the same subnet.
misc/python-presence.service is a systemd service than can be used
as-is after copying to /etc/systemd/system.
The files are also available in the data folder of the PyPi package.
Metadata
Release files for python-presence 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| python-presence-0.1.6.tar.gz | 26.2 kB | Without provenance | Details for python-presence-0.1.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python_presence-0.1.6-py3-none-any.whl | Python 3 | none | any | Details for python_presence-0.1.6-py3-none-any.whl |
Total release size: 53.5 kB
Release files / python-presence-0.1.6.tar.gz
| Download URL | python-presence-0.1.6.tar.gz |
|---|---|
| Size | 26.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9396f29e1468b0268f69210a43e2549e50f28c2d86ada07aebd92a65106afffd
|
|
BLAKE2b-256 checksum How to use checksums |
a32d57d8910a3a7281c73bb4d3d32f9cb8fc6ac0db377426b377ba4b72ad4f16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / python_presence-0.1.6-py3-none-any.whl
| Download URL | python_presence-0.1.6-py3-none-any.whl |
|---|---|
| Size | 27.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8ebba0d4baf40c860f5d75e975b9a8c3e1380a388a90b295113d61f6efb468c7
|
|
BLAKE2b-256 checksum How to use checksums |
028390baf67072cbf64691efc9f2c4d9c64a01f06ef2ec4db8edd33232086290
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Security for python-presence 0.1.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.