wikimedia-abusefilter-accounts
Find abuse filter accounts across Wikimedia wikis. This is handy for reports and scripts that need the real local sysop list without counting these accounts as normal admins.
Install
python3 -m pip install wikimedia-abusefilter-accounts
Use it
Get the accounts from one wiki:
from abusefilter_accounts import get_abuse_filter_accounts
accounts = get_abuse_filter_accounts("enwiki")["enwiki"]
Or get them from every open wiki:
from abusefilter_accounts import get_abuse_filter_accounts
accounts = get_abuse_filter_accounts()
One wiki can be a db name, host, or full URL:
get_abuse_filter_accounts("enwiki")
get_abuse_filter_accounts("en.wikipedia.org")
get_abuse_filter_accounts("https://en.wikipedia.org")
Get several wikis the same way:
get_abuse_filter_accounts(["enwiki", "de.wikipedia.org", "https://fr.wikipedia.org"])
Use a separate MySQL option file when needed:
get_abuse_filter_accounts("enwiki", cnf_file="/path/to/my.cnf")
Result
The result is a dictionary keyed by wiki db name. Usernames are normal strings, and _ is changed to a space.
{
"enwiki": ["Example Account"],
"dewiki": [],
}
When no wikis are given, the package reads meta_p.wiki and uses the db names where is_closed = 0. When wikis are given, only those wikis are queried. Duplicate db names are processed once.
Credentials
When cnf_file is supplied, that file is used for every database connection. Otherwise the package checks ~/replica.my.cnf first and then ~/.my.cnf. When neither exists, normal toolforge.connect() handling is used.
How it finds them
For each wiki, the package looks for an active local sysop account with no revisions. These are the accounts the package treats as abuse filter accounts.
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.0.tar.gz.
File metadata
- Download URL: wikimedia_abusefilter_accounts-0.1.0.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbcf115045c3f9acef2c3c60b5ca46b6f5007e48bbfdeec21bf1ae1d4f642c8f
|
|
| MD5 |
dd53535b850e7a73924917ba2f9cc04f
|
|
| BLAKE2b-256 |
f0548756d38d912c07e2b3e314cc46037be052a55d072dccd2da2e38189b174d
|
File details
Details for the file wikimedia_abusefilter_accounts-0.1.0-py3-none-any.whl.
File metadata
- Download URL: wikimedia_abusefilter_accounts-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.4 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 |
40fe9c032cb921c243baf363e183e6e3ec48634508c557390e86379ebfda7cf8
|
|
| MD5 |
93aded8ccd2c0d6464c9c18e279b2e32
|
|
| BLAKE2b-256 |
1fa6c9d0dc5f3c0c3ca386d009da5b7b4935f7b4cb9e04354f7a90cca7a98d68
|