LocalModeration for Matrix
A CLI tool for bulk message deletion, media cleanup, and sticker purge in public (unencrypted) Matrix rooms. Encrypted messages are skipped automatically.
Installation
View on PyPI: pypi.org/project/localmoderationmatrix
Using pip:
pip install localmoderationmatrix
Using uv:
uv tool install localmoderationmatrix
Standalone Executable: GitHub Releases
Session
Once logged in, your session is saved in your home directory. Just enter your User ID on the next run to auto-login.
If you need to clear the saved session, type reset as your User ID.
Usage
localmoderationmatrix <room_id> [options]
Parameters
| Parameter | Description |
|---|---|
room_id |
(Required) The Matrix room ID. |
--search |
Search for a single keyword. |
--file |
Search using a wordlist file (one word per line). |
--interactive |
Scan room once and enter Interactive Hub mode. |
--purge-media |
Delete media older than X days (0 for all). |
--purge-sticker |
Delete stickers older than X days (0 for all). |
--log-room |
Room ID to send moderation logs. |
--days |
Time filter: Days (Default: 0). |
--hours |
Time filter: Hours (Default: 1). |
--minutes |
Time filter: Minutes (Default: 0). |
--homeserver |
Custom homeserver URL. |
Interactive Keys
y: Delete.n: Skip.a: Delete All remaining items automatically.q: Quit current review (returns to menu in Interactive Mode).
Examples
Search for a keyword:
localmoderationmatrix "!roomID:matrix.org" --search "spam"
Scan with a wordlist and log actions:
localmoderationmatrix "!roomID:matrix.org" --file words.txt --days 7 --log-room "!LogRoomID:matrix.org"
Delete media older than 90 days:
localmoderationmatrix "!roomID:matrix.org" --purge-media 90
Interactive Mode (Scan once, filter instantly):
localmoderationmatrix "!roomID:matrix.org" --interactive --days 7
Building from Source
PyPI Package:
uv build
Standalone Executable:
pyinstaller --onefile --name LocalModerationMatrix --clean --noconfirm --optimize 2 --collect-all localmoderationmatrix src/localmoderationmatrix/cli.py
License
Apache-2.0
Metadata
Release files for localmoderationmatrix 1.1.0
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 |
|---|---|---|---|---|
| localmoderationmatrix-1.1.0.tar.gz | 18.2 kB | Without provenance | Details for localmoderationmatrix-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| localmoderationmatrix-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for localmoderationmatrix-1.1.0-py3-none-any.whl |
Total release size: 35.1 kB
Release files / localmoderationmatrix-1.1.0.tar.gz
| Download URL | localmoderationmatrix-1.1.0.tar.gz |
|---|---|
| Size | 18.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
78c3d1ed815de251f02cf19f2239898531319f49b06757e035c22b6d514063c5
|
|
BLAKE2b-256 checksum How to use checksums |
f8c4b38cfe63b18588c02d92c852b32f4ac8f02d44eb3c08d521c47006b6c162
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / localmoderationmatrix-1.1.0-py3-none-any.whl
| Download URL | localmoderationmatrix-1.1.0-py3-none-any.whl |
|---|---|
| Size | 16.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f2d2ce8a66eaf54f941c97789d33190a0f7b76c9e12609f27ede417601c0718
|
|
BLAKE2b-256 checksum How to use checksums |
b634651eb8d23abd9b65fa8c4ab0a38a142c3d4960c4f02669e5499831ff95ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for localmoderationmatrix 1.1.0
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.