Page MenuHomePhabricator

What's in a name? Task 2
Closed, ResolvedPublic

Description

This is the second task for T300207, What's in a name? Automatically identifying first and last author names for Wikicite and Wikidata, aimed at getting you familiar with Pywikibot.

  1. You should register a Wikimedia account if you don't already have one. You can do so at https://www.wikidata.org/w/index.php?title=Special:CreateAccount
  1. You should download and install Python 3 and pywikibot - see instructions at https://www.mediawiki.org/wiki/Manual:Pywikibot/Installation . You will need to set up a user configuration file, and make sure you can log in. Set 'wikipedia' as the base family, and then manually add usernames['wikidata']['wikidata'] = u'Your username' into the generated user-config.py file. If you want, you can set a bot password (see https://www.mediawiki.org/wiki/Manual:Pywikibot/BotPasswords ) and use that - or use your normal Wikimedia login information.
  1. Set up a script that will connect to Wikidata, load the 'Outreachy_1' page that you created in the previous task, and print it out.
  1. Try adding 'Hello' to the end of the page you just loaded, and save it back.
  1. Load a Wikidata item (use 'Q4115189' to start with - it is the sandbox), and print out information from it. You can then try loading the items for the scientific articles you looked at in the first task. You should try to print out all of the author information that is available in the item (at least the names, ideally also the qualifiers).

Bonus: automatically follow links to items about the authors, and print out their name information as well (e.g., given/family names).

Save your code to a repository, or create a page like https://www.wikidata.org/wiki/User:Mike_Peel/Outreachy_2 (under your username)

Once you are happy, send me a link to your page (by email, on my talk page, or replying to this ticket as you prefer). Make sure to also register it as a contribution on the Outreachy website ( https://www.outreachy.org/outreachy-may-2022-internship-round/communities/wikimedia/whats-in-a-name-automatically-identifying-first-an/contributions/ )!

Hints:

Event Timeline

Hi, I'm sorry, I'm temporarily unavailable - I'll reply as soon as I can, most likely on Tuesday.

Good day. I have encountered an error when I was trying to edit my script. My terminal is telling me that my username is not defined, but it is defined. In my user-config.py file I have this line of code, usernames['wikidata']['wikidata'] = 'Kundaichasinda', because Kundaichasinda is my username. May you please help

Good day. I have encountered an error when I was trying to edit my script. My terminal is telling me that my username is not defined, but it is defined. In my user-config.py file I have this line of code, usernames['wikidata']['wikidata'] = 'Kundaichasinda', because Kundaichasinda is my username. May you please help

Hi @Kundaichasinda, is that the username you used to create your wikidata/MediaWiki?

@Vivian yes it is the same username I used to create my wikidata

Good day. I have encountered an error when I was trying to edit my script. My terminal is telling me that my username is not defined, but it is defined. In my user-config.py file I have this line of code, usernames['wikidata']['wikidata'] = 'Kundaichasinda', because Kundaichasinda is my username. May you please help

Hi @Kundaichasinda can you check that the user-config.py file is in the same directory as the code you're running? That can sometimes cause unexpected problems, if the code can't find the user-config.py file.

Hi, I'm sorry, I'm temporarily unavailable - I'll reply as soon as I can, most likely on Tuesday.

Just to note that I'm catching up now. I should be back to normal availability from 4 April onwards.

@Mike_Peel thank you for your response. The bug has been fixed

Hi Mike @Mike_Peel and Andy @Pigsonthewing,
Hope you are doing well!

I am a little unsure about my understanding upon this task:

  • In "5. You should try to print out all of the author information that is available in the item." - I suppose the 'author information' refers to the author names & qualifiers on the article's item page.
  • In "Bonus: automatically follow links to items about the authors, and print out their name information as well." - I assume the 'name information' refers to the author names on the author's item page (e.g. Given name, family name..)

Update on Apr.4th, 2022: Based on this understanding, I completed this contribution and put my codes on: https://www.wikidata.org/wiki/User:Jiehui_Ma/Outreachy_2

May you please check if my understanding meets the task requirement and give any possible suggestions on my coding styles?

I greatly appreciate your time and patience!

Best Regards,
Jiehui

Hello, I have a problem generating user configuration files after installing pywikibot on my Windows 11 system. After entering "python pwb.py generate_user_files" on the command prompt, I get an [errno2] message saying "No such file or directory."

What can I do?

@Azaya89 Hi Azaya, I've met such issues before, I suppose you may use the 'cd' command to change your directory to the directory of your installation file. For me it's like inputting 'cd /Users/majiehui/Downloads/core_stable'.

@Azaya89 Hi Azaya, I've met such issues before, I suppose you may use the 'cd' command to change your directory to the directory of your installation file. For me it's like inputting 'cd /Users/majiehui/Downloads/core_stable'.

Thanks a lot. it has worked now.

I am a little unsure about my understanding upon this task:

Yes, your understanding was correct. I've tried to clarify the task description accordingly, does that look better?

Yes, your understanding was correct. I've tried to clarify the task description accordingly, does that look better?

Thank you for updating and helping me confirm this! Based on these details, I think my codes and functions has followed the requirements.

I would be grateful if you could then check my submission and comment on my coding styles. If there are coding lines too vague for you to understand, plase feel free to tell me. I am still working on to improve my current contributions.

Thank you for your time!

Yes, your understanding was correct. I've tried to clarify the task description accordingly, does that look better?

Thank you for updating and helping me confirm this! Based on these details, I think my codes and functions has followed the requirements.

I would be grateful if you could then check my submission and comment on my coding styles. If there are coding lines too vague for you to understand, plase feel free to tell me. I am still working on to improve my current contributions.

Thank you for your time!

You have a reply on the discussion page. :-)

Hello!

See attached my attempt at Task 2.
https://www.wikidata.org/wiki/User:PangolinMexico/Outreachy_2

I'd really appreciate feedback on the auto_add_name script I made. Thank you so much!

@PangolinMexico You have a reply on the talk page.

Thank you so much! I replied with a few possible suggestions regarding your question as well as a question about your own script. Take your time to answer --- I'll get on task 3 now! Thanks again!

Hi @Mike_Peel, here's my completed task two attempt. I await your feedback, thanks!

https://github.com/Azaya89/Outreachy-Wikidata-project/blob/main/myscript.py

Note: I'm unable to create a new wiki page for my Outreachy task 2. I get an error message saying my IP has been blocked on all wikis due to Open Proxy. Is there a way to resolve this?

Hello @Mike_Peel and @Pigsonthewing,
Hope you are well!
I have completed task 2 and expecting feedback from you.
Link of the task:-Outreachy_2

I highly appreciate your time and support.

Hi @Mike_Peel, here's my completed task two attempt. I await your feedback, thanks!

https://github.com/Azaya89/Outreachy-Wikidata-project/blob/main/myscript.py

Note: I'm unable to create a new wiki page for my Outreachy task 2. I get an error message saying my IP has been blocked on all wikis due to Open Proxy. Is there a way to resolve this?

Hi, this looks good, you can count it as completed for Outreachy. I've marked your account as IP block exempt, can you try again and see if that's fixed it? For Task 3, please use Q51538190 - you'll need to use RIS rather than Bibcode for this (due to the subject area), which you can download from https://www.nature.com/articles/nbt1070#citeas

I have completed task 2 and expecting feedback from you.

I have left feedback on the talk page - https://www.wikidata.org/wiki/User_talk:DwivediAntima/Outreachy_2

Hi @Mike_Peel, here's my completed task two attempt. I await your feedback, thanks!

https://github.com/Azaya89/Outreachy-Wikidata-project/blob/main/myscript.py

Note: I'm unable to create a new wiki page for my Outreachy task 2. I get an error message saying my IP has been blocked on all wikis due to Open Proxy. Is there a way to resolve this?

Hi, this looks good, you can count it as completed for Outreachy. I've marked your account as IP block exempt, can you try again and see if that's fixed it? For Task 3, please use Q51538190 - you'll need to use RIS rather than Bibcode for this (due to the subject area), which you can download from https://www.nature.com/articles/nbt1070#citeas

Thanks a lot. It has been fixed and I have also posted my task 2 work on the page. Here it is: https://www.wikidata.org/wiki/User:Azaya89/Outreachy_2

Getting on task 3 now...

I have completed task 2 and expecting feedback from you.

I have left feedback on the talk page - https://www.wikidata.org/wiki/User_talk:DwivediAntima/Outreachy_2

Thank you @Mike_Peel for your valuable feedback. I will complete task-3 in the upcoming days.

Hi @Mike_Peel and @Pigsonthewing , I have completed this task and I have sent the link to my page to your emails. I look forward to completing task 3. Please do not hesitate to inform me of any improvement that can be made! There is always room for improvement :)

Hello @Mike_Peel and @Pigsonthewing,

I have completed task 2 and the link to the same is - https://www.wikidata.org/wiki/User:Akandoria/Outreachy_2. I look forward to your feedback.

Thank you!

Hi, @Bisola7 you have a reply in your email inbox, @Akandoria you have a reply on the talk page.

Hello @Mike_Peel and @Pigsonthewing
I have completed task 2, this is the link to task 2 -https://www.wikidata.org/wiki/User:Varsha_ahirwar_from_India/Outreachy_2.
but there is an issue I tried to add 'Hello' to my wiki page, but it is not working. Please suggest to me some methods to fix it.

Looking forward to your feedback.

Thank you.

Hi, @Mike_Peel and @Pigsonthewing, Please assign a scientific topic for task 3 so that I can start working on task3 as soon as possible.
Thank you.

Hi @301295_kTH Nearly there! I've left feedback on the talk page, at https://www.wikidata.org/wiki/User_talk:Varsha_ahirwar_from_India/Outreachy_2 . You can also find the article you should use for task 3 there.

Hi @301295_kTH Nearly there! I've left feedback on the talk page, at https://www.wikidata.org/wiki/User_talk:Varsha_ahirwar_from_India/Outreachy_2 . You can also find the article you should use for task 3 there.

Thank u so much for your feedback.
I am putting my code and output in a GitHub repository, I think it will be easy for you to reproduce the output.

Hello @Mike_Peel, I have uploaded the code and output of Task 2 on GitHub,
this is the link for the same-https://github.com/varsha089/Varsha-ahirwar-outreachy-task-2/tree/main.
If there are any improvements that I could implement please let me know.

Thank you

Hello @Mike_Peel https://phabricator.wikimedia.org/p/Mike_Peel/,
I am getting an error during fetching the URL -
https://www.researchgate.net/publication/253799173_Plasma_physics_and_radiation_hydrodynamics_in_developing_an_extreme_ultraviolet_light_source_for_lithography/citation/download
,
which you have assigned to me for task 3.

I am using this code -
import urllib.request
import pywikibot

with
urllib.request.urlopen('
https://www.researchgate.net/publication/253799173_Plasma_physics_and_radiation_hydrodynamics_in_developing_an_extreme_ultraviolet_light_source_for_lithography/citation/download')
as response:

html = response.read()

and getting this error-urllib.error.HTTPError: HTTP Error 403: Forbidden
CRITICAL: Exiting due to uncaught exception <class 'urllib.error.HTTPError'>

I think my code is right, I can not understand why I am getting this error.
Please tell me what should I do.

Hello @Mike_Peel and @Pigsonthewing ,

I made a few improvements discussed on the discussion page https://www.wikidata.org/wiki/User_talk:Akandoria/Outreachy_2. I'd be grateful if you could review them and provide me with the feedback so that I can submit Task 3 accordingly.

Thank you for your time!

Hello, @Mike_Peel
How are you today? I have sent you a mail for my task 2. Please do check it :)

Hello Mike_Peel ,
Hope you are doing well
I want to ask want timeline I should fill in outreachy internship period
timeline during submit final applications.

@301295_kTH please see the 'Application and timeline' section of T300207 that describes how to do the timeline.

@Bisola7 you have a reply by email.

@301295_kTH Task 2 looks good, you can count it as completed on Outreachy, sorry for the delay. I'll reply about the task 3 issue on the task 3 ticket.

@Akandoria You have a reply on your talk page.

@301295_kTH Task 2 looks good, you can count it as completed on Outreachy, sorry for the delay. I'll reply about the task 3 issue on the task 3 ticket.

@Akandoria You have a reply on your talk page.

It's ok,
Thank u for your feedback.

Best regards.

@301295_kTH Task 2 looks good, you can count it as completed on Outreachy, sorry for the delay. I'll reply about the task 3 issue on the task 3 ticket.

@Akandoria You have a reply on your talk page.

Thank you!

Mike_Peel claimed this task.