Page MenuHomePhabricator

Generic file title generator for Single Image Batch Upload
Open, LowPublic

Description

When uploading files with T138464: glam2commons (previously Single Image Batch Upload): Write and deploy initial and usable version a uniform way of naming files will be used per metadata-mapping. There are some standard operations which have to be performed to create a good title. Therefore it will be useful to have a title generator.
Ideally the title generator has a default order and some default operations, but it is possible to deviate from the default.

The following elements can be used in a file title:

  • File identifier: the identifier the glam uses for this picture/object (this is useful to ensure unique titles)
  • GLAM name: the name from the institution
  • Collection: Sometimes it might be useful to specify in the file title in which collection the file falls. Either the metadata-mapping is for a single collection (then GLAM name could be used and an additional Collection is not needed), it is however also possible that a mapping is made for multiple collections at once.
  • file name/title: These are not always provided, therefore a good default would be to use the title if available and otherwise the file description
  • file descriptions: A file description can be very lengthy, therefore it is a good idea to set a limit on the length of the description. Something to crop descriptions at the last whitespace before X characters would be ideal.

I believe a good order is: title OR description - optionally collection - GLAM - ID . EXTENSION

Also try to test whether the title does not contain forbidden characters.
Allowing to specify the ordering of the title if from a metadata mapping we'd like to use something different from the default would be ideal.

Event Timeline

Hello @Basvb, so I got freed from extra activities and decided to take a closer look at this project. So I have some understanding of the project and have attempted to do the above micro-task (not completely though).
So I used the sample single_image_batch_upload which you provided. So I did install pywikibot and did some minor modifications to the code. Working on this make me come up with some questions which will help me making this task smooth and broaden my understanding of the project.

So I uploaded some images to my own Commons page using the UploadRobot() from pywikibot and modified your NationalArchieve script to create a sample flask app with it. I also created a sample title generator class. (the whole code isn't pretty yet as I am still having some minor worries.

Some worries I am facing

  • I am a little bit confused with the use of ID and file identifier. (the former being used in the main project description).
  • Please I wish to have a guide to selecting GLAMS and how do I determine them as relevant.
  • This is a link to the work I did today (https://github.com/djff/single_batch_upload) and I hope to implement upload on one other GLAM by tomorrow to clarify all my doubts.
  • Any other help or comment is highly appreciated.

Thanks

hello @tom29739 , I want to also look at Wikimedia's OAuth. Will be greatful if I could have some guide on this. Thanks

I know I am a little bit late on this but, I hope to complete my proposal by thursday 30th

@djff: I am resetting the assignee of this task because there has not been progress lately (please correct me if I am wrong!).
Resetting the assignee avoids the impression that somebody is already working on this task. It also allows others to potentially work towards fixing this task.
Please claim this task again when you plan to work on it (via Add Action...Assign / Claim in the dropdown menu) - it would be welcome! Thanks for your understanding!