Proposal for T215682
Name: Jerop Brenda
IRC nickname on Freenode: brendajerop
Web Profile: https://brendajerop.github.io
Typical working hours: 8:00 AM to 7:00 PM EAT (UTC+3)
1. Summary of the project
The MediaWiki Action API is a REST API that provides access to wiki features like creating an account, logging in, creating and editing a page, searching for a title and many more. A complete description is available here.
This project aims to improve the documentation of the API by re-writing it to follow this template and adding code samples to demonstrate the use of the API modules. A demo app based on some of the modules will also be created and a tutorial to explain its implementation will be written. The complete description of this project is available at T215682
My idea for the demo app is an app that fetches the day’s holidays and observances from Wikipedia as shown here. This idea and its implementation will be subject to change as seen fit by the project mentors.
- Fetch the day’s holidays and observances using API:Parse and list them.
- Allow searching for holidays by date.
- Users can log in to add a new holiday. This will make use of API:Assert to check whether the user is logged in. If not, use API:Login to log the user in then use API:Edit to add a new holiday.
- I will use Python, Flask, HTML, CSS and Jinja templating.
- The app will follow Wikimedia’s design principles and will assume a mobile layout. This is because the app's screens will not have a lot of content hence it will be a better use of space to have the app occupy a smaller area of the screen. Following a Mobile-First design will also ensure that the app looks and functions well on all platforms with the least amount of code. Having less code will ensure that the tutorial stays simple since it's mostly targeted at beginners.
- An interactive mock-up of the app is available here
- I also created a similar but basic app for proof of concept at holidaystoday.herokuapp.com.
2. Benefits of the project
By following a template, consistency will be achieved in the documentation. This provides a uniform way to give information hence making the use of the API more intuitive to new users. It also makes it easier for new contributors to understand how to edit and add new information.
Adding code samples and creating a demo app based on the modules will provide a practical means of understanding the API. This is especially important to new users and to users whom the documentation has not been translated into their language.
Before interns are announced: Today to May 6
- Complete the tasks which are a work in progress and work on new tasks as I go through the tutorials at API:Main_page in order to improve my Python, Flask, HTML and CSS skills.
Before the internship starts: May 6 to May 20
- Create a spreadsheet to analyse and document the state of the 50th to the 77th most-viewed pages as shown in Massviews Analysis in order to determine the amount of work needed in each page and the order of the pages to be edited.
- Refine my ideas for the demo app and document my progress here.
May 20 to July 22 (9 weeks)
- Improve the documentation of two API modules per week for a total of at least 20 modules at the end of the 9 weeks . The process followed each week will be similar for each module, i.e:
- Create a separate git branch for the module, write sample code, commit it and open a pull request on GitHub for review.
- Implement the requested changes if any as I work on the respective documentation of the module in my wiki sandbox.
- Once the pull request is merged, I will integrate the sample code into the documentation.
- Once the documentation is ready, I will send it to the mentor for review and implement any feedback received.
- After the documentation has been approved by the project mentor, I will integrate it into the main-space and mark it as modified on T198916.
- Finalize on demo app idea and mock-ups.
July 22 to July 30 (Week 10)
- Start working on the demo app.
- Write the base classes which will be extended by the specific feature classes. This is because some of the app's features will have a slightly similar layout and functionality.
- Implement "List Holidays" feature, test it and include instructions for its implementation in a draft of the app's tutorial in my sandbox.
- Submit the app to the project mentor for review and implement any feedback received.
At the end of week 10, the most basic and working version of the app will be complete.
July 30 to August 6 (Week 11)
- Implement "Search Holidays by Date" feature, test it and include instructions for its implementation in a draft of the app's tutorial in my sandbox.
- Implement "Logging in" feature, test it and include instructions for its implementation in a draft of the app's tutorial in my sandbox.
- Submit the app for review and implement any feedback received.
August 6 to August 13 (Week 12)
- Implement "Add New Holiday" feature, test it and include instructions for its implementation in a draft of the app's tutorial in my sandbox.
- Submit the app for review and implement any feedback received.
- Make any required improvements and fix any bugs that may have arised.
At the end of week 12, the app will be complete with all the intended features.
August 13 to August 20 (Week 13)
- Refine the app's tutorial and send the final draft to the mentor for review.
- Once the draft has been approved, I will include it in the tutorials section of API:Main_page and prepare it for translation.
August 20 onwards
- Keep contributing to Wikimedia and volunteer as a mentor for Google Code-in.
- I will communicate my progress to my mentor and ask for help on project-related issues through Zulip on the mediawiki-api-documentation-project stream.
- I will ask for help on API-related issues on the Wikimedia Developer Support channel.
- Throughout the internship period, I will document detailed progress through weekly blog posts on my blog.
- I joined the University of Nairobi, Kenya, in 2015 to pursue Electrical and Electronic Engineering but took a year off in September 2018. On my first holiday from college, I attended a boot camp where I learnt Java and got introduced to Android Programming. On completion, I became a part of NaiCode, a community that teaches programming to high school students in Kenya.
I later got selected for the Google Africa Scholarship Program to learn Intermediate Android Development. During that period, I also served as a community mentor to guide the beginner students through their Android Development course. My certificates for participation as a student and as a mentor are available here and here respectively.
In August 2018, I applied to Y Combinator’s Startup School and luckily, all the companies that applied were accepted for that cohort. My Startup School profile is available here.
- How did you hear about this program? I learnt about this program through Twitter, on a previous participant’s timeline.
- Will you have any other time commitments, such as school work, another job, planned vacation, etc, during the duration of the program? No, I will not have any other time commitments during the duration of the program.
- We advise all candidates eligible for Google Summer of Code and Outreachy to apply for both programs. Are you planning to apply to both programs and, if so, with what organization(s)? I took a year off from school so I will not be able to apply for Gsoc this round.
- What does making this project happen mean to you? As an avid user of FOSS(I use Linux, Firefox, LibreOffice and VLC), this project provides a platform through which I can give back to FOSS because most open-source organisations use MediaWiki-powered wikis. It will also grant me a good entry point into open-source contribution.
This project will also boost my skills, improve my confidence and shape me as a programmer. This is because I will be working in a mentored environment with a structured workflow where proper code documentation, organization, testing and coding styles need to be followed. Also, I love both writing and programming, and this project is a bridge between the two.
1. Contributions to Wikimedia
- API:Querypage: Improved the documentation and wrote sample code to demostrate its use in querying uncategorized pages.
- API:RecentChanges: Improved the documentation and wrote sample code to demostrate its use in fetching the three most recent changes with their sizes and flags.
- API:Links: Wrote sample code to demonstrate its use in fetching missing links from a page. I also added this example to the documentation.
Documentation and API-related
- I added a new feature to Addwiki's mediawiki-api library to get all the pages that are linked to from a given page: T186581 Merged. I used API:Info as a property and API:Links as a generator in order to complete the task. While working on this task,I learnt how to use both prop and generator in one request in order to get the desired result, and that module parameters should be prefixed with a g if the module is being used as a generator. The library is coded in PHP and I had never used PHP before so I also got to learn PHP as a bonus:)
- I documented the undocumented classes in Addwiki's mediawiki-api library: T145376 The different classes use different API modules hence I interacted with their corresponding MediaWiki API modules in order to have a better understanding of how the classes work. As a result, I got to understand how to use these API modules. The classes which I documented are:
- LogListGetter Merged: Gets all logged events in a wiki by using API:Logevents.
- UserGetter Merged: Gets information about a user in a wiki by using API:User .
- RevisionUndoer Merged: Undoes a certain revision in a wiki by using the "undo" parameter of API:Edit.
- RevisionRollbacker Merged: Reverts the last series of edits made to a wiki page by using API:Rollback.
- RevisionDeleter Merged: Deletes the content of a revision by using the hide parameter of API:Revisiondelete.
- RevisionRestorer Merged: Restores content that has been revision-deleted by using the show parameter of API:RevisionDelete.
- RevisionPatroller Merged: Patrols a revision by using API:Patrol.
- RevisionSaver Merged: Saves edits to a revision by using API:Edit.
- UserCreator Awaiting Review: Adds a new user to a wiki by using API:Account creation.
- UserBlocker Awaiting Review: Blocks a user by using API:Block.
- UserRightsChanger Awaiting Review: Changes the group membership of a user by using API:Usergroup membership.
- I prepared the Africa Wikimedia Developers wiki pages for translation. This was after I asked(and received a yes) on AWMD's talk page if it would help the project to have the pages translatable, and if I could work on it. I chose this task because it would help more people learn about AWMD and because of the frustration I had faced when working with translatable pages. This task helped me to learn about various translation markup and their appropriate uses. The first page I prepared went through heavy correction from Shirayuki but I learnt from the corrections and improved as I prepared more pages. The pages I prepared are:
- I documented how to add citations to a page if the Citoid service has been configured on a wiki: T108980 Merged. While working on this page, I learnt about Wikimedia’s guide to technical documentation, which I followed in order to give structure, clarity and consistency to the guide. I also got to learn how to work with translatable pages and learnt about concepts like qqx. Working on the guide also improved my wiki markup skills.
- I corrected the auto-generated documentation for parameter headhtml in module parse: T139567 Merged. When starting to work on this task, I wasn't sure if I was editing the correct file so I set up a local MediaWiki instance in order to confirm if the changes to the code were reflected on the wiki. Having a local MediaWiki instance later came in handy while working on tasks which required a wiki user to have admin or bureaucrat permissions. For instance when trying to create a test account on Wikipedia via the API, the limit per IP address is 6 trials in 24 hrs but with a local MediaWiki instance, I could raise the limit. In some cases, the documentation includes examples which have API parameters that are introduced by extensions(e.g OpenID). In this case having a local MediaWiki instance where I could install the extensions was helpful.
- I included links of the corresponding API modules in Pywikibot methods.: T100521 Merged. I modified the docstrings of all APISite methods in site.py which are thin wrappers around a MediaWiki API module to include a link to the corresponding API documentation. Working on this task helped me discover more MediaWiki API modules and what they do. I also learnt how to write docstrings in Epytext format.
- I documented Special:MergeHistory: T195271 Merged. While working on this page, I got to improve my documentation and wiki markup skills. I also got a better experience in working with translatable pages.
- I added unit tests to the Africa Wikimedia Stats Tool: T205450. I had never written unit tests before and working on this task introduced me to and helped me learn how to write unit tests. I chose this task in order to learn how to write unit tests in case it will be a requirement when developing the demo app. The links to my patches are:
- Refactored sample code for account creation: Awaiting Review I refactored code for account creation via the MediaWiki API if captcha is enabled in a wiki.
- I added a feature to Wikimedia Commons Android app to include tabs that display featured images and images uploaded via the Android app.: Merged. I got to learn about other Wikimedia APIs and what they do.
- Modified the auto-generated documentation to include information about hidden parameters which have been revision-deleted: T186573 Awaiting review. While working on this task, I got a deeper understanding of the MediaWiki Action API because I had to do revision-deletion on a wiki and then query these modules to in order to check their responses after revision-deletion. As a result, I got to understand how to use these modules. The modules are:
- I documented the batchcomplete element of the MediaWiki Action API: T84977 Awaiting review. Working on this task helped me get a deeper understanding of the API and also improved my technical documentation and wiki markup skills. I queried several modules in several ways, e.g using them as a generator or as a property submodule in order to find cases where the batchcomplete element was not returned. As a result, I learnt a lot about generators, property submodules and how to use continue until the batchcomplete element is returned. I also learnt that batchcomplete is meant for modules which are submodules of the query module.
- Wrote and modified documentation for Commons Template:IsNum: T120366 Awaiting review. Working on this task gave me a deeper understanding of templates, how they work and how to use them. It also improved my wiki markup skills.
- Added code to automatically close the Floating Action Button.: Merged. I added an enhancement to the Commons Android app to automatically close the Floating Action Button in the upload activity after a user has uploaded an image.
- Converted mediawiki.org links in extensions from http to https: T189687. Merged. The patches for the extensions are:
- Removed PHP entry points in extensions which have JSON entrypoints: T140007 Awaiting review. The patches for the extensions are:
- Added a LICENSE file and added the license code to extension.json in extensions which did not have license information: T123943 Awaiting review. The extensions are:
2. Contribution to open source
The Mifos Initiative
- Added support for Swahili to Mifos Android Client: Merged. Working on this task helped me learn how to use git for collaboration. I learnt how to rebase, squash commits and resolve merge conflicts.
- Added code to Mifos Android Client to remove irrelevant space in an accordion: Under Review
3. Other projects
- Holidays Viewer- A web-app that fetches the current day’s holidays and observances from Wikipedia using API:Parse and lists them. I created this app in order to practise building the demo app and to refresh my Python, Flask, HTML and CSS skills. While working on the app, I learnt about and followed Wikimedia’s design principles in regards to colours, typography and visual style.
- A simple school system app- A Flask CRUD web app that allows creation, editing and deletion of student data. This app was created as part of a group assignment at school. While working on this app, I got introduced to Python, Flask, HTML, CSS and SQL.
- Simple blog-I created a simple blog while learning how to use Django at a Django Girls event.
- Github-Repos- An app that fetches a users repositories using the GitHub API. Working on this app helped me understand how APIs work, specifically REST APIs.
- HideContacts-A contacts app that can’t be read by other apps. It doesn’t save contacts in vcf format so other apps like Whatsapp and Facebook don’t recognize it as a contacts app and hence they can’t read contacts from it. This improves privacy. I created this app after completing YC’s Startup School program where I learnt about concepts like Key Performance Indicators and Lean Software Development. The app currently has 1000+ users.
- Orodha- An app that simplifies the process of creating an exam merit list for Kenyan teachers who don’t have access to computers.
- TicTacToe- An Android version of Tic Tac Toe. I created this as a capstone project for an Android development course.
- Goodnight- An android app to auto-send a goodnight message to specific people at a specific time
I created these apps during a hackathon to demonstrate the usage of the Java GUI.
- Screensaver- An app that creates wallpapers and screensavers by drawing spirographs on the screen.
- Paint app- A painting app that allows you to paint on a screen by dragging the mouse. You can also change the colour of the pen, the background colour and the thickness of the pen.
- Touch-type Practice- An app that allows you to practise touch-typing by giving you a word to type against a set time limit. It has a virtual keyboard on the screen that highlights any key pressed.
- Animated-card- An animated get-well-soon card with background music.
- Medical-Diagnosis- An app to diagnose lifestyle diseases using Matlab’s Neural Network Toolbox. I created this app as a requirement of a class assignment.