A comprehensive collection of Python scripts utilizing the
pywikibotframework to automate, clean, and manage tasks across Wikimedia projects (Wikimedia Commons, Wikipedia, Wiktionary, etc.). These tools are engineered to handle large-scale batch processes, metadata generation, cross-wiki translations, and emergency rollbacks with built-in safety mechanisms.
Unicode_description_generator.py— Smartly extracts Unicode hex codes from filenames (e.g.,U+0995) and auto-generates structured Commons descriptions with dynamic font names and Compart links.Unicode CSV metadata generator.py— Scans local folders of glyphs and builds complete upload-ready CSV metadata files mapped to official Unicode blocks.Unicode Name Database Generator.py— Extracts Python's internal Unicode database into a lightweight, frontend-ready JS/JSON file.
UNI Character Category.py— Intelligently categorizes uploaded glyphs into specific character categories, broad shape categories (Arrows, Box Drawings), or strict hex categories.upload_log_categorizer.py— Scans a specific user's upload log and safely appends tracking categories (e.g., "Uploaded by Bot") to thousands of files.Soft redirect resolver for recent edits.py— Scans recent edits and automatically replaces soft/hard redirected categories with their true target categories.
wiktionary_batch_importer.py— Fetches entries fromen.wiktionary, automatically translates grammatical headings (Noun, Verb, Etymology) into the target language, and imports them to the local Wiktionary.Batch find-replace.py— A universal mass-translator and cleaner that fixes residual English words, formatting errors, and broken templates across namespaces.
emergency_batch_reverter.py— A cross-wiki rollback tool. Scans recent edits by a specific bot/user and safely reverts them to the previous revision if a batch operation goes wrong.Batch page mover or renamer.py— Renames files or pages in bulk based on exact string matching, with options to suppress redirects.
- Ensure Python 3.x is installed on your system.
- Install the core dependencies via terminal:
pip install pywikibot requests
Ensure your user-config.py and user-password.py are properly configured in your Pywikibot directory for authentication.
💻 How to Use Each script is built with a dedicated CONFIGURATION section at the top. Simply open the desired script, modify the target wiki, language, and category parameters to suit your needs, and execute:
python script_name.py💡 Pro Tip: Most scripts include a DRY_RUN = True toggle. Always use this to safely test your logic and review the console output before making live edits!
This project is open-source and available under the CC BY-SA 4.0 License.
Developed with ❤️ by MS Sakib