Jupyter Notebooks are Open Source web apps that allow you to create and share documents that contain live code equations, visualizations, and text. Jupyter notebooks are incredibly flexible and have many uses. They can function as a light weight browser based development environment that allows you to execute code and display text, equations, images and more all on the same page.
Uses include:
Little or no programming skill is required to use Jupyter notebooks. They are used by a robust community users in in technology and the sciences. There are many examples and resources for new and advanced users to draw on, making them a powerful tool for users along the technical spectrum.
PAWS: A Web Shell (PAWS) is a service that hosts Jupyter notebooks for use by Wikimedia's contributors. PAWS users can launch, publish, and fork notebooks without having to install Jupyter on a local computer. Users only need a Wikimedia SUL and a internet connected web-browser to use the service.
PAWS makes it easier for volunteers along the spectrum to work in technical spaces and make contributions Wikimedia's technical projects.
Some things you can use PAWS for Wikimedia technical projects include:
1) Launch PAWS in your browser.
2) Sign in with MediaWiki.
3) Allow Oauth permission.
4) Party! You're in! 😄
You can create and navigate your notebooks and files from the PAWS control panel. Now that you are in the PAWS control panel, you may want to take some time to have fun and explore on your own.
In the upper left corner, you'll find some options for existing notebooks:
The "Files" tab provides you with several options for actions you can take with your notebooks.
The "Running" tab lets you see which terminals and notebooks you have running, what kernel they are on, and their status.
In the upper right corner, you'll find an option to upload or create a new notebook:
As you can see, you have the option to use several different programming languages: Bash, Python 3, and R. You can also create a text file or folder or run a terminal.
For the purpose of this tutorial, we'll create a Python 3 notebook and navigate through some of the basics of how to use it.
From your PAWS control panel create a new Python 3 notebook.
Your brand new notebook will start with one empty Code cell by default:
Notebooks are organized using separate cells that can contain text or executable code. Each cell is its own unit of text or code that can be executed within the cell. You can change the position of cells within the notebook; you can merge cells; you can insert new cells anywhere you like, allowing you to intermix code and text.
You can run code alone in a cell or run all the cells in order to perform more complex operations.
Note: The order of the cells in the notebook and the order that they are run in is important. If you run all cells at once, the notebook will run them in order of top to bottom. However, because you can run cells separately, it is possible you could run them out of order, -- especially if you go back and revise a cell you already created -- and this can affect the outcome of your operation.
You can change the nature of the cell from the dropdown on the menu:
From the top menu you can save, add, remove, copy, move, and run cells. There are keyboard shortcuts for each of these functions, as well.
Click the Command Panel button to find a comprehensive list of commands available to you.
The first thing you want to do is give our notebook a descriptive title. This will help you find it easily in your control panel. Since all notebooks hosted on PAWS are publicly available, this will allow others to understand the content of your notebook quickly, too.
You can do this by clicking the "Untitled" text at the top left of your screen and entering a new title.
You can change the name of your notebook at anytime, either by clicking through the title from your notebook or from your PAWS control panel.
While working in PAWS, your notebook will be saved automatically from time to time. You can view when the notebook was last checkpointed and saved at the top of your screen.
You can also save and checkpoint your notebook by clicking the File tab in the menu.
You can also download your notebook in a number of file formats. This can be helpful if you are planning on using your notebook for other purposes later.
There are several ways to share your notebook.
1) Click the "Public Link" button
2) Alter the URL manually to get the public link to your notebook: https://public.paws.wmcloud.org/User:YOURUSERNAME/YOURNOTEBOOK.ipynb
If you want to build on the work of an existing public notebook, you can create a copy of it for your personal use (AKA "fork"), and upload it to your PAWS control panel.
1) Get the URL of another public PAWS notebook. Example: https://public.paws.wmcloud.org/YOURUSERNAME/YOURNOTEBOOK.ipynb
2) Add ?format=raw
to the end of the URL to download a raw .ipynb file. Example: https://public.paws.wmcloud.org/YOURUSERNAME/YOURNOTEBOOK.ipynb?format=raw
3) Log into your PAWS account and use Upload button to upload this copy into your own control panel.
template.ipynb
that includes imports of packages, settings, and code snippets you frequently use. You can use Duplicate when you are ready to create a new notebook.Licensing
Copyright 2020
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.