Accessing Coursera learning material offline

So Coursera is awesome right? But one thing that really bothered me was that I was not able to access material offline. My commute is a whopping 3 hours so yeah, I could make use of that time to read up on stuff!! (Yes i do look out the window.....but still!)

There is this repository on Github suggested by a co-worker that is excellent for this exact purpose.
But getting up and running is a little difficult for someone who may be isn't into programming or may be new to Python as well. (Python is a language used to do a lot of stuff , but is popular for data analysis).

Before you begin you will need a Coursera account and be enrolled (free or paid) in a course.
So whatever be your background, do the following to get access to the learning material of your Coursera course offline.
This will download the learning material to your computer in a very organized way and you will be able to read and watch videos without needing the internet.

Oh also goes without saying that that you honor these https://www.coursera.org/about/terms
Respect Coursera and use this only to download material you rightfully have access to. 
Yeah!! Thats right, I don't condone fraud!! 

1. Download and Install Python.

Python is a programming language (for the non-techies think of it as a regular language) that you can write programs (like essays, notes, poems) in for various purposes.

We will be using this simply as a tool for downloading our Coursera material from the Coursera website.

Download and install the latest version of Python from here.  https://www.python.org/downloads/
The installation steps are very simple to understand and implement. Hit me with questions if you cannot proceed.

Our Coursera material will be downloaded as a Python package. 

Remember the location on your computer where Python was installed. ⬟

2. Download and Install pip. 

What is pip? (Sheesh just get us the material alreadyyyyy!!!!)
Pip is a simple tool (installer) that helps us download packages authored in Python. 
Like any installer that helps you install a program from a vendor site. Simple right? 

Follow these steps. 
a. You will need to use the Terminal on your system. 
For Mac users simply launch "The TERMINAL" and for Windows users use 'cmd".

For getting comfortable with the terminal use this . (Yes you have to work a little hard for everything!! )

b. Using your terminal "navigate" to your location where Python was installed. 

```
$ cd your_python_location
$ ls
```
This should show you a list of contents at this location. Search for pip(version#) and python(version#)

c. Download pip from here get-pip.py

d. Go back to your terminal and update it using this
`````````````````````````
$ python(version#) path_to_your_downloaded_pip/get-pip.py

`````````````````````````
Should look like this




Pip is now good to go!! You can now use it to install any python package. 
Remember our Coursera material will be downloaded as a Python package? 


3. Download and install 'virtualenv' package 

--optional , You could skip to Step 4 directly. 

The reason to do this is a bit complex for non-technical folk, but to sum it up in one sentence, you create a virtual environment to maintain separate python directories with their separate isolated dependencies. 

If your pip download and install was correct the following will work. Enter the following commands (description in braces).

```````````````````````
$ pip(version#) install virtualenv

```````````````````````
Should look like this





Navigate to location where you wish to create your virtual environment. 

```````````````````````
$ cd path_to_create_your_virtual_env

```````````````````````

Create the virtual environment by entering the follwing command.
```````````````````````
$ virtualenv MyPythonEnv

```````````````````````

Activate the virtual environment.
```````````````````````
$ source path_to_create_your_virtual_env/bin/activate 
(this runs the activate script at that location)

```````````````````````

4. Get your Coursera material.

If you have followed step 4 the terminal should look like this now
(MyPythonEnv) YourComputer : your_project_path Username $ 

The Coursera material will be downloaded via a Python package/script called 'coursera dl'
a. Using pip, install coursera dl using the following command
```````````````````````
$ pip install coursera-dl

```````````````````````
Should look like this















b. Run the script to download material 

```````````````````
coursera-dl -u your_coursera_Userid -p your_coursera_pwd name_of_your_course

````````````````````

Remember the 'name_of_your_course' should be matching the text in https://www.coursera.org/learn/name_of_your_course/home/welcome

This will commence the download of the materials if your login details and course name is correct. 
Your terminal will display the status of the download very clearly. Keep monitoring your terminal. 

Should look like this.







5. Study! Study! Study!


Tada!!

ps: Hit me with questions in the comments section if required. 

Comments

  1. Just use the official python installer with default settings (check 'install pip' and 'add python to system path') and you can jump to Step 4. Saves a lot of hassle.

    ReplyDelete
  2. Thanks a lot. Where will it download it to.

    ReplyDelete

Post a Comment

Popular posts from this blog

d3 Collapsible tree vertical

Adding and deleting Angular directives dynamically (Part 1)