Another xmppsend script
Project description
Sendi
Sendi is just another xmppsend script. Sendi is based on python slixmpp library and support fews modern features like HTTP Upload and Omemo.
Usage
To use it, you have to create a config file that permit us to access login information.
The default path of config file is $XDG_CONFIG_HOME/sendi/config.toml
[section_name]
host="mysuperndd.ndd" # host of the jabber server, default to localhost
port=5222 # jabber port to use, 5222 is the default
password="superpassword" # JID account password, this is required
jid="user@mysuperndd.ndd" # JID of the sender user, this is required
# Connection can be either
# - "standard" which mean Starttls based.
# - "tls" using directly tls connection.
# standard is the default
connection_type="standard"
# Security level can be either
# - "simple" : don't encrypt end2end
# - "encrypted" use omemo (XEP-0384 and XEP-0454)
# standard is the default
security_level="simple"
# Lang metadata in message to send, default to en
# this is rarely used by software but may be useful in some case
lang="en"
# log level for logging of sendi and library used.
# default to ERROR (40)
# other value : 10: DEBUG, 20:INFO, 30:WARN, 50: CRITICAL
loglevel=0 # max log
# custom omemo cache path, by default use "$XDG_CACHE_HOME/sendi/@bare_jid@.json" based path to keep
# omemo config for all jid used.
omemo_cache_file_path= "/tmp/mycache.json"
# force delete omemo cache path before running, useful if cache is broken.
clear_omemo_cache=true
Command line Usage
$ sendi [OPTIONS] CONFIG_NAME TARGETS...
Arguments:
CONFIG_NAME
: Config section to use form the config_file[required]TARGETS...
: List of jabber id of receivers [required]
Options:
--message TEXT
: simple text message to send.--file-path PATH
: path of the file to send (using http-upload feature)--config-file PATH
: Config file in toml [default: $XDG_CONFIG_HOME/sendi/config.toml]--install-completion
: Install completion for the current shell.--show-completion
: Show completion for the current shell, to copy it or customize the installation.--help
: Show this message and exit.
Config file sample:
Dev install
Install pyinvoke and then:
pip install invoke
invoke init
Run python code:
invoke build
# Typer Cli
rye run sendi
CONFIG_NAME="user"
CONFIG_PATH="config.toml"
TARGET="receiver@localhost"
rye run sendi $CONFIG_NAME $TARGET --config-file=$CONFIG_PATH --message="Ping !" --file-path=tests/test_image.jpg
Install Using Container(podman):
CONFIG_NAME="user"
CONFIG_PATH="config.toml"
TARGET="receiver@localhost"
invoke build
invoke build-container
podman run -v $PWD:/mnt localhost/sendi $CONFIG_NAME $TARGET --config-file=/mnt/$CONFIG_PATH --message="Ping !" --file-path=/mnt/tests/test_image.jpg
Experimental: Install as Deb using Wheel2deb.
Use this method only if you know what you are doing, this may break your system. I tested this only in debian-bookworm.
invoke init-deb
invoke build-deb
cd deb
ls -la *.deb
# Only 5 lib from the huge number of generated lib are require to make sendi work.
# I prefer to keep debian as standard as possible.
sudo apt install ./python3-twomemo_*.deb ./python3-oldmemo_*.deb
sudo apt install ./python3-omemo*.deb
sudo apt install ./python3-slixmpp_*.deb
sudo apt install ./python3-slixmpp-omemo_*.deb
sudo apt install ./python3-sendi_*.deb
Build Container for arm64 arch on amd64 host
- you need buildah (podman) and qemu_user_static.
- clean up
dist
anddeb
dir. invoke build
.invoke container-build -p linux/arm64
.
FAQ ?
- Why this name, sendi ?
It's an esperanto verb: https://en.wiktionary.org/wiki/sendi
- Why AGPL v3 ?
I used slixmpp, slixmpp-omemo and reuse some part of the old apprise xmpp plugin which as been dropped. The license rule make possible to release all the stuff only under the agplv3 license which is the slixmpp-omemo one.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sendi-1.0.tar.gz
.
File metadata
- Download URL: sendi-1.0.tar.gz
- Upload date:
- Size: 269.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fef012c7c83b4e1a5c5c7893226a5a4679c39f41e31e56fc6512ae7bfffedeb |
|
MD5 | d992925e1d4da3892ba54f7dcae45d33 |
|
BLAKE2b-256 | 26c3e1df6260c243352574dac68aa83e5b27f68a3d558afd2bfd2207cf31a247 |
File details
Details for the file sendi-1.0-py3-none-any.whl
.
File metadata
- Download URL: sendi-1.0-py3-none-any.whl
- Upload date:
- Size: 23.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0cebde4ad7d19c5ab945634b71eddda06b55128d8f9a6fe60463bdcb9e4b85d |
|
MD5 | 80e902ce83b268b6f6a5abe7f7c64547 |
|
BLAKE2b-256 | e9daa1afaccd5382e1bdedba43439d420895efff2c5e12ab617014a01d5fef81 |