GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ehoda9/python-complete-reference: Structured Python reference as Jupyter notebooks: fundamentals, OOP, regex and type hints. Also on Kaggle.

BranchesTags
Open more actions menu

Latest commit

 

History

29 Commits
29 Commits

Folders and files

NameName
Last commit message
Last commit date
kaggle
kaggle
 
 
notebooks
notebooks
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

Python Complete Reference

A structured, notebook-based Python reference: from syntax basics to object oriented programming, iteration tools, the standard library, regular expressions and type hints. Every topic is a notebook with a quick summary table, explanations and code examples.

Read it online: Python Complete Reference Notebook on Kaggle

What is inside

  • Offline notebooks in notebooks/: 97 notebooks in 14 folders, one topic per notebook, meant for studying and quick lookup.
  • One unified notebook in kaggle/: all 14 parts in a single file (341 cells, 152 of them code) with a clickable roadmap, a table of contents and an A-Z index of every name it explains. It is designed to run top to bottom without manual input and is the source of the Kaggle notebook above.

Scope

A beginner-to-intermediate refresher: short explanations, quick tables and runnable examples, meant for revision and quick lookup rather than deep dives.

Not covered: metaclasses, C extensions, CPython internals, packaging and publishing, threads, processes and asyncio, networking (urllib, socket), subprocess, web frameworks and data-science libraries.

Learning order

The parts follow a learning path: each part builds on the ones before it. A few one-line examples in Parts 1 and 5 use a construct that is explained later (for example try in Data Types). The Suggested background column lists the earlier parts whose ideas a part uses. Quick References (keywords and built-in functions) is meant for lookup at any time.

Find things fast

You want to... Use
Look up a name (function, method, keyword) The A-Z index at the end of the unified notebook
Find the tool for a job ("how do I remove duplicates?") 14 - Quick References/04 - Task Index
See every method of str, list, tuple, dict or set 14 - Quick References/03 - Methods of Built-in Types
Recall a syntax or the options of a topic The quick table at the top of every notebook
See all keywords or built-in functions The first two notebooks of Quick References

Roadmap

Part N of the unified notebook is the folder N - ... in notebooks/, and section N.M is file M - ... inside that folder. For example, section 4.9 (Decorators) is 04 - Functions/09 - Decorators.

Part Topic Notebooks What it covers Suggested background
1 Python Basics 8 Comments, variables, data types, operators, type conversion, user input, string formatting, modules and import Start here
2 Control Flow 4 if / elif / else, while and for loops, match / case Part 1
3 Data Structures 6 Lists, tuples, sets & frozen sets, dictionaries, references and copying, booleans, container comparison guide Parts 1-2
4 Functions 13 Return values, parameters, defaults, *args / **kwargs, scope, recursion, lambda, decorators, docstrings, type hints, PEP 8 Parts 1-2
5 Errors, Debugging & Profiling 4 Exception types, raise, try / except / else / finally, tracebacks, assert, pdb, timeit, cProfile Parts 1-2, 4
6 Comprehensions, Iterators & Generators 7 List, set, dict and generator expressions, nested comprehensions, iterables vs iterators, generators, scope and the walrus operator Parts 1-2, 4-5
7 Standard Library Essentials 6 math, statistics, decimal, random, datetime, collections, functools Parts 1-2, 4-6
8 Itertools 8 Infinite iterators, slicing and filtering, chaining and zipping, accumulate / pairwise / batched / tee, groupby, combinatorics, recipes Parts 1-2, 4-7
9 Files & Data Formats 6 Reading and writing files, file modes, pathlib, os / sys / shutil, JSON, CSV Parts 1-2, 4-7
10 Regular Expressions 5 Regex syntax, character classes, quantifiers, groups, assertions, the re functions, flags and performance Parts 1-2, 4
11 Object Oriented Programming 16 Classes, encapsulation, inheritance and MRO, custom exceptions, polymorphism, ABCs, dunder methods, context managers, descriptors, dataclasses, class patterns, design patterns Parts 1-2, 4-7, 9
12 Advanced Type Hinting 4 TypeVar and generics, protocols, TypedDict, Self, TypeGuard, overload, ParamSpec, runtime introspection, 3.14 notes Parts 1-2, 4-5, 7, 11
13 Building Real Programs 6 Packages and the __main__ guard, command-line arguments, external packages with pip, logging, unittest, doctest Parts 1-2, 4-6, 9, 11
14 Quick References 4 All 35 keywords with examples, the built-in functions by category, every method of str, list, tuple, dict and set, and a task index (how do I...?) Parts 1-2, 4-9, 11

Notebook index

Open 00 - Python Notebook Content for a quick offline index, or use the list below.

01 - Python Basics (8 notebooks)
  • 01 - Comments
  • 02 - Variables
  • 03 - Data Types
  • 04 - Operators
  • 05 - Type Conversion
  • 06 - User Input
  • 07 - String Formatting
  • 08 - Built-in Modules
02 - Control Flow (4 notebooks)
  • 01 - If Elif Else
  • 02 - While Loop
  • 03 - For Loop
  • 04 - Match Case
03 - Data Structures (6 notebooks)
  • 01 - Lists
  • 02 - Tuples
  • 03 - Sets & Frozen Sets
  • 04 - Dictionaries
  • 05 - References, Identity & Copying
  • 06 - Boolean & Containers Comparison
04 - Functions (13 notebooks)
  • 01 - Functions Basics
  • 02 - Return Statement
  • 03 - Parameters & Arguments
  • 04 - Default Parameters
  • 05 - Args Kwargs & Unpacking
  • 06 - Function Scope
  • 07 - Recursion
  • 08 - Lambda Functions
  • 09 - Decorators
  • 10 - Docstrings
  • 11 - Type Hints Foundations
  • 12 - Collections, Union Types & Type Aliases
  • 13 - Coding Style (PEP 8)
05 - Errors, Debugging & Profiling (4 notebooks)
  • 01 - Errors & Exceptions
  • 02 - Exception Handling
  • 03 - Debugging
  • 04 - Measuring Performance
06 - Comprehensions, Iterators & Generators (7 notebooks)
  • 01 - Comprehensions Foundations
  • 02 - Conditions, Multiple Loops & Nested Comprehensions
  • 03 - Dict, Set & Generator Expressions
  • 04 - Iterable vs Iterator
  • 05 - Generators
  • 06 - Scope & the Walrus Operator
  • 07 - Performance, Readability & Best Practices
07 - Standard Library Essentials (6 notebooks)
  • 01 - math, statistics, decimal & fractions
  • 02 - random
  • 03 - datetime & time
  • 04 - Counter & defaultdict
  • 05 - deque, namedtuple, OrderedDict & ChainMap
  • 06 - functools
08 - Itertools (8 notebooks)
  • 01 - Itertools Foundations
  • 02 - Infinite Iterators
  • 03 - Filtering & Slicing Iterators
  • 04 - Chaining, Zipping & Mapping
  • 05 - Accumulate, Pairwise, Batched & Tee
  • 06 - Grouping with groupby
  • 07 - Combinatoric Iterators
  • 08 - Recipes, Patterns & Best Practices
09 - Files & Data Formats (6 notebooks)
  • 01 - File Handling
  • 02 - Additional File Methods
  • 03 - Paths with pathlib
  • 04 - os, sys & shutil
  • 05 - JSON Files
  • 06 - CSV Files
10 - Regular Expressions (5 notebooks)
  • 01 - Regular Expressions Foundations
  • 02 - Regex Syntax, Character Classes & Quantifiers
  • 03 - Regex Groups, Alternation & Assertions
  • 04 - Regex Functions, Match Objects & Replacement
  • 05 - Regex Flags, Performance & Best Practices
11 - Object Oriented Programming (16 notebooks)
  • 01 - OOP Foundations
  • 02 - Classes, Instances & __init__
  • 03 - Attributes & Methods
  • 04 - Encapsulation & Properties
  • 05 - Class & Static Methods
  • 06 - Inheritance & super
  • 07 - Custom Exceptions & Chaining
  • 08 - Multiple Inheritance, MRO & Mixins
  • 09 - Polymorphism, Duck Typing & Composition
  • 10 - Abstract Base Classes
  • 11 - Dunder Methods & Operator Overloading
  • 12 - Context Managers
  • 13 - Object Model, Descriptors & __slots__
  • 14 - Dataclasses & Enums
  • 15 - Class Patterns
  • 16 - OOP Design, Advanced Patterns & Best Practices
12 - Advanced Type Hinting (4 notebooks)
  • 01 - TypeVar, Generic, Literal, Final & ClassVar
  • 02 - Protocols, TypedDict, NamedTuple & Callable
  • 03 - Advanced Type Hints_ Self, TypeGuard, overload, ParamSpec & Annotated
  • 04 - Typing Tools, Runtime Introspection & Python 3.14 Notes
13 - Building Real Programs (6 notebooks)
  • 01 - Packages & the __main__ Guard
  • 02 - Command-Line Arguments
  • 03 - External Packages
  • 04 - Logging
  • 05 - Unit Testing with unittest
  • 06 - doctest
14 - Quick References (4 notebooks)
  • 01 - Keywords
  • 02 - Built-in Functions
  • 03 - Methods of Built-in Types
  • 04 - Task Index

Read it offline

Export the unified notebook to a single HTML file. It opens in any browser without Python or an internet connection, and the roadmap links and Ctrl+F search work:

jupyter nbconvert --to html --execute kaggle/Python-Complete-Reference.ipynb

--execute runs every cell first and stops at the first error, so the command also checks that the notebook still runs top to bottom.

Run it locally

Only Python and JupyterLab are needed. The notebooks use the standard library only, so there is nothing else to install.

cd python-complete-reference
pip install jupyterlab
jupyter lab

Notes:

  • Python version: use Python 3.13 or newer for the offline notebooks. Two notebooks demonstrate newer features (type aliases need 3.12+, typing.TypeIs needs 3.13+). The unified notebook in kaggle/ includes version guards and is written to run on Python 3.11 or newer. It was executed from top to bottom on Python 3.12.
  • Run cell by cell in the offline notebooks. Some cells show errors or wait for keyboard input on purpose, so "Run All" can stop early there. The unified notebook is the version designed for "Run All".
  • Language: everything in this repository is in English.

Repository layout

python-complete-reference/
├── README.md
├── LICENSE
├── kaggle/
│   ├── Python-Complete-Reference.ipynb   # unified notebook (source of the Kaggle notebook)
│   └── kernel-metadata.json              # Kaggle API metadata
└── notebooks/
    ├── 00 - Python Notebook Content.ipynb
    ├── 01 - Python Basics/
    ├── 02 - Control Flow/
    ├── 03 - Data Structures/
    ├── 04 - Functions/
    ├── 05 - Errors, Debugging & Profiling/
    ├── 06 - Comprehensions, Iterators & Generators/
    ├── 07 - Standard Library Essentials/
    ├── 08 - Itertools/
    ├── 09 - Files & Data Formats/
    ├── 10 - Regular Expressions/
    ├── 11 - Object Oriented Programming/
    ├── 12 - Advanced Type Hinting/
    ├── 13 - Building Real Programs/
    └── 14 - Quick References/

Update the Kaggle notebook

After editing kaggle/Python-Complete-Reference.ipynb, push it with the Kaggle CLI:

kaggle kernels push -p kaggle

Keep your Kaggle API credentials (kaggle.json) out of the repository. It is already listed in .gitignore.

License

MIT

Maintained by mahmoud15 on Kaggle. Issues and suggestions are welcome.

About

Structured Python reference as Jupyter notebooks: fundamentals, OOP, regex and type hints. Also on Kaggle.

www.kaggle.com/code/mahmoud15/python-complete-reference-notebook

Topics

cheatsheetjupyter-notebookkagglelearn-pythonooppythonpython-referenceregextype-hints

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.