CLI wrapper around Pywikibot for simpler Wikimedia Commons uploads
Project description
It is a wrapper around pywikibot to make uploading to Wikimedia Commons from CLI simpler.
Install
From PyPI:
pip install pwb-wrapper-for-simpler-uploading-to-commons
With shell autocompletion support:
pip install 'pwb-wrapper-for-simpler-uploading-to-commons[autocomplete]'
Usage
Installed CLI command:
pwb-upload --file my.jpg --source https://example.com --license 'PD-old' --category 'Sunsets in Batumi' --date '2025-12-27' --desc 'A beautiful sunset from the beach' --target myrenamed.jpg
For multiple categories, repeat --category:
pwb-upload --file my.jpg --category 'Sunsets in Batumi' --category 'Evening in Georgia' --date '2025-12-27'
Default source is {{own}}.
Default license is cc-by-4.0.
--target (file name on Commons) is optional.
--prefix (prefix for file name on Commons) is optional.
--i lets you start from a specific index.
--recursive includes files from subfolders when no file is specified.
You can upload with minimal arguments:
pwb-upload --file my.jpg --category 'Sunsets in Batumi' --date '2025-12-27'
Or pass the file as positional argument:
pwb-upload my.jpg --category 'Sunsets in Batumi' --date '2025-12-27'
Or upload without category and date (set them later on Commons):
pwb-upload my.jpg
If no file is specified, it uploads eligible files from the current folder (no subfolders by default).
To include subfolders:
pwb-upload --recursive
For local development (without installation), you can still run:
./upload.py --file my.jpg
Author: for the current user use me.
Autocompletion
Enable completion for the installed command:
eval "$(register-python-argcomplete pwb-upload)"
Release to PyPI
Build distribution files:
python3 -m build
Upload to TestPyPI:
python3 -m twine upload --repository testpypi dist/*
Upload to PyPI:
python3 -m twine upload dist/*
Wikidata item about this tool https://www.wikidata.org/wiki/Q137601716
Commons category https://commons.wikimedia.org/wiki/Category:Uploaded_with_pwb_wrapper_script_by_Vitaly_Zdanevich
See also
My another Python script for uploading to Commons from gThumb
Project details
Release history Release notifications | RSS feed
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 pwb_wrapper_for_simpler_uploading_to_commons-0.1.4.tar.gz.
File metadata
- Download URL: pwb_wrapper_for_simpler_uploading_to_commons-0.1.4.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc918d619ac41ff33e30e8ade77e9fab852b8447dec7350cc3190b3f8f5bdc2b
|
|
| MD5 |
d89e449ea91f124694077f1ee46436f0
|
|
| BLAKE2b-256 |
414ff4a3acb0f27005b87c663fc0905d2f47f3be3928d854f36e494ab5e5049e
|
File details
Details for the file pwb_wrapper_for_simpler_uploading_to_commons-0.1.4-py3-none-any.whl.
File metadata
- Download URL: pwb_wrapper_for_simpler_uploading_to_commons-0.1.4-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a55e24e11dcd57cad7270bca717c71318d8b6fde9de12e3414b0cb54d705958
|
|
| MD5 |
e28c1e761b04f0a65752e47cfda22390
|
|
| BLAKE2b-256 |
2f729f79a57b9d819881f0d781a0b2c026cef69994b02267ecdc756bd8cece1b
|