Skip to main content

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:

https://wikimedia-abusefilter-accounts.readthedocs.io/

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wikimedia_abusefilter_accounts-0.1.2.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file wikimedia_abusefilter_accounts-0.1.2.tar.gz.

File metadata

File hashes

Hashes for wikimedia_abusefilter_accounts-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c40dc9a71ff41718d1351defa28ed9478e6d134ee207457f41a5581004e968aa
MD5 bcf92d8683dec1fd232f411cb4e91a74
BLAKE2b-256 440dd74711489a688995641eb604e0ac6b94b786f086198d6f3fd94c5dace1c8

See more details on using hashes here.

File details

Details for the file wikimedia_abusefilter_accounts-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for wikimedia_abusefilter_accounts-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 912e3e533e94b2546c3bc5d9357757e471ff6e48f7d523e49958a6f66e82787b
MD5 43ec2c8e79c7faca4751bf1c27ff118a
BLAKE2b-256 a538f455b36a7897dc2274981a6e7184652c67a26a79857ee36144839735454f

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page