Blog Post #1: The Skeletal Framework ⚙️

DebadityaPal
Published: 06/16/2021

During this week, I analyzed the flow of data in my project and modelled the classes accordingly. The course data is expected to be stored in a YAML file, hence the first thing that I needed to implement was a YAML parser. Thankfully, Python has a package aptly named yaml for that specific purpose. The course file would have the following structure:

Now once we have the raw data from the YAML file, we need to give it some structure for ease of computation. I decided to have the following heirarchical structure.
  • Course
    • Chapter 1
      • Snippet 1
      • Snippet 2
      • Snippet 3
    • Chapter 2
      • Snippet 1
      • Snippet 2

Once this was decided, I went on to create the basic classes for a Course, Chapter and Snippet. My plan is to keep these classes as base classes so that in future if more features are to be added, the newer classes can simply inherit the base functionalities from these classes. However these classes will also need to have a few restrictions like, some mandatory fields of data, some mandatory functions being implemented for all subclasses that inherit this class and so on. For the latter I aim to explore metaclasses in Python. The metaclass can be used to control how a certain class behaves.
DJDT

Versions

Time

Settings from gsoc.settings

Headers

Request

SQL queries from 1 connection

Static files (2312 found, 3 used)

Templates (11 rendered)

Cache calls from 1 backend

Signals

Log messages