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 Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay