wikimedia-abusefilter-accounts
Find abuse filter accounts across Wikimedia wikis. This can be useful for reports and scripts that need to work with local sysop accounts without counting these accounts as regular admins.
Install
python3 -m pip install wikimedia-abusefilter-accounts
Usage
Get the accounts from one wiki:
from abusefilter_accounts import get_abuse_filter_accounts
accounts = get_abuse_filter_accounts("enwiki")["enwiki"]
Get them from all open Wikimedia wikis:
from abusefilter_accounts import get_abuse_filter_accounts
accounts = get_abuse_filter_accounts()
A wiki can be given as a database name, hostname, or full URL:
get_abuse_filter_accounts("enwiki")
get_abuse_filter_accounts("en.wikipedia.org")
get_abuse_filter_accounts("https://en.wikipedia.org")
You can also pass several wikis:
accounts = get_abuse_filter_accounts([
"enwiki",
"de.wikipedia.org",
"https://fr.wikipedia.org",
])
To use a specific MySQL option file:
accounts = get_abuse_filter_accounts(
"enwiki",
cnf_file="/path/to/my.cnf",
)
Result
The result is a dictionary keyed by wiki database name:
{
"enwiki": ["Example Account"],
"dewiki": [],
}
Usernames are returned as strings, with underscores replaced by spaces.
When no wikis are provided, the package checks the open wikis listed in meta_p.wiki. When wikis are provided, only those wikis are checked.
Credentials
By default, the package uses the MySQL configuration available to Toolforge.
When cnf_file is provided, that file is used instead. Otherwise, the package checks ~/replica.my.cnf first and then ~/.my.cnf.
How it works
For each wiki, the package finds active local sysop accounts with no recorded revisions. These are the accounts returned as abuse filter accounts.
Limitations
This package needs access to Wikimedia replica databases, so it only works in Wikimedia environments such as Toolforge, PAWS, or Cloud VPS.
Documentation
Full documentation is available at:
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wikimedia_abusefilter_accounts-0.1.2.tar.gz.
File metadata
- Download URL: wikimedia_abusefilter_accounts-0.1.2.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c40dc9a71ff41718d1351defa28ed9478e6d134ee207457f41a5581004e968aa
|
|
| MD5 |
bcf92d8683dec1fd232f411cb4e91a74
|
|
| BLAKE2b-256 |
440dd74711489a688995641eb604e0ac6b94b786f086198d6f3fd94c5dace1c8
|
File details
Details for the file wikimedia_abusefilter_accounts-0.1.2-py3-none-any.whl.
File metadata
- Download URL: wikimedia_abusefilter_accounts-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
912e3e533e94b2546c3bc5d9357757e471ff6e48f7d523e49958a6f66e82787b
|
|
| MD5 |
43ec2c8e79c7faca4751bf1c27ff118a
|
|
| BLAKE2b-256 |
a538f455b36a7897dc2274981a6e7184652c67a26a79857ee36144839735454f
|