Skip to main content

CS50 Notes And Psets Reader

Project description

Notes50

A CS50 Notes And PSets Reader.

Video Demo: https://www.youtube.com/watch?v=wtuPx1vHtjo

Arguments

-x : CS50X
-p : CS50 Python
-w : CS50 Web
-g : CS50 Games
-a : CS50 Ai

Syntax

-Argument Week: Week For Which Notes To Read 
-Argument Week/PSets: Week For Which PSets To Read

Examples

To Get CS50X Week 0 Notes
- python notes50.py -x 0

To Get CS50X Week 0 Pset Scratch
- python notes50.py -x 0/scratch

Programming

Notes50 Is Written In Python
With A Mix Of Multiple Pip Libraries Which You Can Find In Requirements.Txt

Some Of The Important Libraries Are:
    - Argparse: 
        I Used Argparse To Add Arguments Of Courses And Help Function 
    - Urllib:
        I Used Urllib Function Request To Get The Html File From The CS50 Website
        At First I Used Requests Library But It Had A Weird Problem When Encountered
        With Smart Quotes Causing It To Display Weird Symbol Thats Why I Then Changed It To Urllib
    - Beautifulsoup: 
        After Urllib Gets The Website Source Code I Used Beautifulsoup To Parse It 
        It Turns The Html Tags To Be Programmable And Understandable To Other Libraries 
        Like Markdownify And I Used Lxml To Parse The Html.
    - Markdownify:
        Rich Has A Markdown Library That Parses Markdown The Way It Was Intended And Prints It To The Terminal 
        That'S Why I Needed A Html To Markdown Library So I Searched A Little And Used Markdownify.
    - Rich: 
        Rich Has A Markdown Function That Prints Markdwon To The Terminal 
        And Some Syntax Highliting That'S Why I Used It To Print Markdown

Functions

These Are The Functions That I Have
    - Parse_Args:
        Parse_Args Is A Function That Uses Argparse And Adds Arguments 
        Such As The Course Flags And The Help Flags And Parses It 
        And Then Returns It To The Main Function.
    - Help:
        Help Function Makes A Examples Text And Returns It To Argparse To Use It.
    - Note: 
        A Kind Of A Url Parser That Turns And Add The Given Input To CS50 Courses Notes Url 
        And Then Passes It To The Get Function. 
    - PSet: 
        Just Like Note Function Pset Also Parses The Given Input 
        And Adds It To PSets Url Of CS50 Courses And Then Passes It To The Get Function.
    - Get: 
        Get Function Gets The Given Arguments Url Source Code Using Urllib Library 
        Then That Source Code Is Passed To Beautifulsoup And It Parses Using Lxml To Pretty Html And
        Then Gets Its Main Tag Text Which Is Passed To Markdownify Function 
        That Turns It To Markdown Which Again Is Passed To Rich Function 
        That Turns The Markdown To Actual Markdown And Then Return That To The Calling Function 
        And It Is Printed To The Terminal By The Main Function.

Caching

I Used Joblib To Cache The Results As Getting The Html Causes Some Delay
So By Using Caching It Can Return Previously Used Results Without Any Wasted Time
It Uses Appdirs To Get The User Cache Directory
The First Time Maybe Slow But From The Second Time 
It Will Be Fast As It Will Cache The First Results.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

notes50-0.0.5.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

notes50-0.0.5-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file notes50-0.0.5.tar.gz.

File metadata

  • Download URL: notes50-0.0.5.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for notes50-0.0.5.tar.gz
Algorithm Hash digest
SHA256 9b0850a0120845e58c7a1bf2098a2bc5fe87bce6e3588481e0c8b568b7c24c71
MD5 8bb497373833df69675b15ef9fa43254
BLAKE2b-256 db7ea0a5ba4a42f860d3b2705de3ee9287b24b17e69ab88bee45e9dad04b1d2a

See more details on using hashes here.

File details

Details for the file notes50-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: notes50-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for notes50-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 088a5e91c590207064af7ea039a47783b5976821eeefd2c039c07bb0aa07e77a
MD5 7a1158a30d5bde79003a32079e69decb
BLAKE2b-256 a2855df729b8e8efd3ea16573e18e74f12613d4ddc4f2db4fb61a2493d6a3611

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page