Skip to content

Instantly share code, notes, and snippets.

@nickserv
Created July 2, 2026 08:36
Show Gist options
  • Select an option

  • Save nickserv/8d1f2f9e995118f1ad797503ab81af07 to your computer and use it in GitHub Desktop.

Select an option

Save nickserv/8d1f2f9e995118f1ad797503ab81af07 to your computer and use it in GitHub Desktop.
Wiki.gg setup for Pywikibot
# Disable default Pywikibot config so we can write it in Python
# PYWIKIBOT_NO_USER_CONFIG=2
import pywikibot
from typing import ClassVar
def create_wiki_gg_site(subdomain: str, code: str = "en"):
class Family(pywikibot.family.Family):
name: ClassVar[str] = subdomain
langs: ClassVar[dict[str, str]] = {code: f"{subdomain}.wiki.gg"}
def scriptpath(self, code):
return ""
def protocol(self, code):
return "https"
return pywikibot.Site(code, Family())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment