Skip to content

thepriben/PyCommonist

Repository files navigation

PyCommonist

Desktop application (Python / PyQt6) for batch-uploading images and media to Wikimedia Commons, inspired by Commonist.

Version 1.2 — main window, MDI upload sessions, {{Information}} and {{Artwork}} wikitext templates, hardened Commons API client.

PyCommonist logo

Installation

From PyPI

pip install pycommonist
pycommonist

From source

git clone https://github.com/thepriben/PyCommonist.git
cd PyCommonist
./run.sh

run.sh creates a virtual environment (Python 3.10–3.12) in ~/.venvs/pycommonist if needed, then starts the application. Or manually:

python3 -m venv ~/.venvs/pycommonist
source ~/.venvs/pycommonist/bin/activate
pip install -r requirements.txt
pip install -e .
python main.py

Usage

  1. Enter your Wikimedia Commons credentials at the top of the window. With two-factor authentication, use a bot password in the form User@BotName.
  2. Open a session via File → New session, choosing a template: Description — {{Information}} (default) or Artwork — {{Artwork}}.
  3. Pick a folder on the left, fill in the global and per-file fields, tick Import, and start the upload.

Default field values can be adjusted in src/pycommonist/resources/config/general.yaml.

Security

  • Credentials are sent only to commons.wikimedia.org over HTTPS and are never stored on disk or written to logs.
  • Every API request carries a descriptive User-Agent and an explicit timeout; authenticated calls use assert=user so an expired session fails visibly instead of uploading anonymously.
  • Bot passwords are supported and recommended.

Testing

An offscreen smoke test covers application start-up, both session types and both wikitext builders — no display or Commons account needed:

QT_QPA_PLATFORM=offscreen .venv/bin/python scripts/smoke_test.py

Releases

Version Archive Tag
1.0 pycommonist-v1.0.zip pycommonist-v1.0
1.1 pycommonist-v1.1.zip pycommonist-v1.1
1.2 pycommonist-v1.2.zip pycommonist-v1.2

History

The project history — including all historical contributions — is maintained in docs/archives/History.md.

PyCommonist is the subject of a magazine article (in French):

PyQt5 : développement d'une application de téléversement d'images vers Wikimedia Commons, 2021, Programmez! n°246, pp. 33–39 (programmez.com).

Credits and license

MIT — see LICENSE. Maintained by @thepriben.

About

A Python/PyQt6 Wikimedia Commons Image Uploader inspired by Commonist.

Topics

Resources

License

Stars

2 stars

Watchers

1 watching

Forks

Contributors