lubianat / pythonpan

A pattypan-like tool for batch upload of files to Commons.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Discussion at at https://www.mediawiki.org/w/index.php?title=TiagoLubiana:Pythonpan

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.

Current big limitations:

  • 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

Workflow

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.

Contributors

  • Tiago Lubiana
  • Your name here! (open to pull requests and suggestions!)

About

A pattypan-like tool for batch upload of files to Commons.

License:Creative Commons Zero v1.0 Universal


Languages

Language:Python 89.8%Language:Jinja 10.2%