Discussion at at https://www.mediawiki.org/w/index.php?title=TiagoLubiana:Pythonpan
Pythonpan is an exploratory project to study the viability of porting or mirroring core functionality of Pattypan using Python.
It was started in Wikimedia Hackathon 2023.
- Only tested in Ubuntu.
- Only a command-line tool.
- Only working for the "Photograph" template
- Only working for users that are uploading photos that they took themselves.
- Only prompting user for a limited number of fields
After cloning the repository to your machine, run python3 generate_metadata.py
to run the code equivalent to pattypan's "Generate Spreadsheet".
The command line will prompt you to fill some categories. Default titles, categories and descriptions can be pre-set in the "./config.yaml" file.
The code will create a "metadata.csv" file in the target folder with the very same fields generated by pattypan.
You can edit and re-save the metadata csv as needed, but the generated metadata.csv
file should work finely.
To upload the files, simulating the "Validate & Upload" button (but without validations), you can run python3 run_upload.py
to start the uploads to commons. It will ask you for the folder with metadata.csv, your username and your password.
- Tiago Lubiana
- Your name here! (open to pull requests and suggestions!)