vyahhi / StepikData

Example of collecting data for thesis project based on Stepik courses data obtained with REST API. As a result, pandas DataFrames for lessons and steps will be obtained.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Collecting data from Stepik courses

This is an example of collecting collecting data for thesis project based on Stepik courses data obtained with Stepik.org REST API. The objective was to get data on each lesson and each step of several courses by its IDs. Script results in two pandas DataFrames with lessons and steps respectively.

Token

You can call Stepik.org API as a registered user, get OAuth2 keys by creating an application. See here for more details. Token is obtained with get_token() function from this example.

Lessons data

Function lessons_info_by_course(course_id, fields, delay) returns pandas DataFrame with data on all lesson of a course. It takes:

Steps data

The data for steps is collected in a similar way. The function steps_info_by_lesson(lesson_id, fields, delay) takes:

  • lesson_id: lesson ID obtained with lessons_info_by_course();
  • fields: list with lesson parameters;
  • delay: similar as above. DataFrame with fields aas columns is returned.

Finally, you can see an example of collectind data for 3 courses.

About

Example of collecting data for thesis project based on Stepik courses data obtained with REST API. As a result, pandas DataFrames for lessons and steps will be obtained.


Languages

Language:Python 100.0%