DEV Community

Pavol Z. Kutaj
Pavol Z. Kutaj

Posted on

How to Build Personal Curicullum Locally in Python

USECASE

The aim of this page πŸ“ is to explain how to learn SQL with Mode's tutorial using Kevin Li's approach with an exciting HN discussion I embarked on my journey to learn SQL using Mode's tutorial and discovered an effective learning strategy from Kevin Li. His approach emphasizes three key points:

  1. Quickly identify foundational knowledge.
  2. Build a personal curriculum to become an expert and avoid the trap of the expert beginner.
  3. Sprint hard for the first 15-20 hours to impress initial memory, then decelerate to a more regular pace.

To build my personal SQL curriculum, I'm using Mode's SQL Tutorial.
I've added an ID (MST) to track my progress, and I quickly create files with numbers and titles of lessons using web scraping with Beautiful Soup. This method allows me to organize my learning material efficiently and monitor my progress easily.

Python Code with Explainer

Initial Setup and HTML Parsing:
We start by importing necessary libraries and fetching the HTML content from Mode's SQL tutorial page.

import requests
from bs4 import BeautifulSoup

url = "https://mode.com/sql-tutorial"

response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')
Enter fullscreen mode Exit fullscreen mode

Extracting Titles:
Next, we find all <h4> elements which contain the lesson titles.

titles = [title.get_text() for title in soup.find_all('h4')]
Enter fullscreen mode Exit fullscreen mode

Creating Files with Formatted Titles:
Finally, we create files for each title, formatted with leading zeros and appropriate naming conventions.

for i, title in enumerate(titles):
    file_name = title.strip().replace(' ', '-').replace('/', '_') + '.md'  # Replace spaces with hyphens and add .md extension
    file_name = f"{i:02d}-{file_name}"  # Prepend index with leading zeros (2 digits)
    open(file_name, 'a').close()  # Open file in append mode to create or update access timestamp
Enter fullscreen mode Exit fullscreen mode

This code ensures that:

  • HTML content is fetched and parsed.
  • Titles of the lessons are extracted.
  • Files are created with formatted titles and indices.

Using this script, I quickly generate organized files in my file system and add content as I progress through the curriculum. This method aligns with Kevin Li's strategy, helping me track my progress and stay motivated in my learning journey.

LINKS

https://news.ycombinator.com/item?id=41909827
https://mode.com/sql-tutorial

Image of Docusign

Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay