Open-source project
xiaolai/the-craft-of-selfteaching avatar
xiaolai/the-craft-of-selfteaching

xiaolai/the-craft-of-selfteaching: a Chinese-language Python course built as a Jupyter notebook book

One has no future if one couldn't teach themself.

17,225 stars17,689 forksJupyter NotebookLicense varies

At a glance

What is it?
The repository is a full-length book on self-teaching that doubles as a beginner Python curriculum, distributed as .ipynb files and a Markdown mirror. It is not a framework, and it is not a library you import, which is the first thing to understand before cloning it.
Who is it for?
Adopt it if you read Chinese and want a structured, opinionated path from zero Python to functions, classes, tests and regular expressions, with a separate appendix that walks through installing JupyterLab and VS Code. Do not adopt it if you need English prose, permissive licensing for reuse, or a maintained software dependency; the repository is a book, not a package.
Can I use it commercially?
Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
Is it still maintained?
Yes. The repository last received commits 132 days ago.
What is it written in?
Mainly Jupyter Notebook, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 26, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What the repository actually is, and who it is written for

This is a book, not a tool. The README describes it as 自学是门手艺, authored by 李笑来, and its one-line thesis is that a person without the ability to teach themselves has no future. The repository holds the book's source: roughly forty Jupyter notebooks at the top level, a markdown/ directory added on 2019-03-23 as a plain-text version, a from-readers/ folder, and a handful of data and sample files such as hdi-china-1870-2015.txt, life-expectancy-china-1960-2016.txt, regex-target-text-sample.txt and mycode.py. The primary language reported for the repository is Jupyter Notebook, which is accurate in the literal sense: the prose and the code live in the same .ipynb files.

The intended reader is a Chinese-speaking beginner who wants to learn programming and, through it, learn how to learn. The table of contents makes the shape clear. Part 1 argues the case for self-teaching and for coding as the entry point, then moves into Python basics: values and operators, control flow, functions, strings, containers, files. Part 2 covers deliberate practice, function arguments, lambda, recursion, docstrings, modules, test-driven development and executable Python files. Part 3 goes to classes, decorators, iterators, generators, regular expressions and BNF/EBNF grammars. Interspersed are chapters that are pure argument: 笨拙与耐心 (clumsiness and patience), 刻意思考 (deliberate thinking), 刚需幻觉 (the illusion of indispensable need), 避免注意力漂移 (avoiding attention drift).

If you are an experienced Python developer looking for a reference, this is the wrong artifact. It is a curriculum with a voice, and the voice is the point.

The mechanism: one notebook per chapter, prose and runnable code interleaved

There is no build system, no package to install, and no runtime. The data flow is the reader's: clone or download the repository, open a notebook, read a cell, run a cell, edit a cell. JupyterLab renders the Markdown cells as formatted prose and the code cells as executable input, so a chapter on recursion can define a function in one cell and call it in the next, and the reader can change the argument and re-run.

The README's own framing of the method is a short Python pseudo-code block, presented as pseudo-code of selfteaching:

python
# pseudo-code of selfteaching in Python

def teach_yourself(anything):
    while not create():
        learn()
        practice()
    return teach_yourself(another)

teach_yourself(coding)

The loop is learn, practice, repeat until you can create something, then start again on a new subject. The repository structure mirrors that claim: the appendix notebooks (T-appendix.editor.vscode.ipynb, T-appendix.git-introduction.ipynb, T-appendix.jupyter-installation-and-setup.ipynb, T-appendix.symbols.ipynb) exist so the reader can set up the tools before starting the main sequence, and 02.proof-of-work.ipynb exists to make the reader demonstrate that the reading happened rather than merely finish it.

That last file is the most unusual design decision in the repository. A book that asks you to prove you read it, and explains how to submit that proof as a pull request, is treating reading as an exercise with an output. The README points contributors at the same notebook for the pull request instructions.

Installing JupyterLab and opening the first notebook

The README is explicit that the first thing to do is read T-appendix.jupyter-installation-and-setup.ipynb, which covers installing JupyterLab locally so the book can be read with a better experience. The appendix is a notebook, so there is a bootstrapping problem: you need a way to open it before you have the tool it tells you to install. In practice the markdown/ directory solves that, since it is the same content in plain text.

The README also links to the upstream JupyterLab project at github.com/jupyterlab/jupyterlab. JupyterLab is distributed on PyPI as jupyterlab, and the conventional install is pip:

bash
pip install jupyterlab

After installation, the launcher is invoked from the directory that holds the notebooks:

bash
jupyter lab

That command starts the server and opens a browser view of the working directory. You should see the notebook list, including 00.cover.ipynb and 01.preface.ipynb. Open 01.preface.ipynb first, then follow the table of contents order. If you prefer to read without running anything, open the markdown/ directory instead; the README added it in March 2019 for exactly that purpose.

The appendix also covers Visual Studio Code in T-appendix.editor.vscode.ipynb and Git in T-appendix.git-introduction.ipynb, so the setup path assumes you will end up with an editor and version control, not just a browser tab. Nothing in the repository pins a JupyterLab version, and the README does not state a supported Python version, so treat the appendix as the authority on your own machine.

Where the book-as-repository approach breaks down

The first limitation is the language. The prose is Chinese. A reader without Chinese gets the code cells and the file names and very little else, and the notebook titles mix Chinese and English in a way that does not substitute for translation.

The second is that .ipynb is a poor format for reading. Notebook files carry execution counts, output payloads and metadata alongside the text, which makes them heavy in Git diffs and awkward to search. The markdown/ directory mitigates this but the README does not describe it as the canonical version, and the two can drift apart.

The third is that this is a book, so its useful life is tied to the reader's, not to a release cycle. The last push to the repository was on 2026-05-20. There are no releases listed. The README does not document a versioning scheme, a changelog, or a rollback path, and it does not state which Python version the examples were verified against. For a Python curriculum that is a real gap: the class, decorator and generator chapters are the ones most likely to be affected by language changes, and the repository gives no signal about when they were last checked.

Finally, the license is a constraint, not a formality. The README states the book is under CC-BY-NC-ND. NoDerivatives means you cannot publish an adapted or translated version, and NonCommercial rules out commercial use. For a teaching resource that is a deliberate choice, but it is a narrow one.

How it compares with the official Python Tutorial

The repository itself points at the alternative. Part.1.G.The-Python-Tutorial-local.ipynb is titled 官方教程:The Python Tutorial, and it is the book's own treatment of the official Python documentation's tutorial. So the comparison is built in rather than implied.

The difference is intent. The Python Tutorial is a language reference written to describe the language accurately and completely, and it assumes you already know what you are doing. This repository uses the same subject matter as a vehicle for an argument about how to learn. That is why the sequence opens with 为什么一定要掌握自学能力 (why you must master self-teaching) and 为什么把编程当作自学的入口 (why start from learning coding) before it reaches a single operator. It is also why Part.1.F.deal-with-forward-references.ipynb exists: the chapter is about how to cope with material that references concepts you have not met yet, which is a pedagogical problem the official tutorial does not address because it is not trying to teach you how to read it.

If you want to learn Python and you already know how to study, the official tutorial is shorter and stays current with the language. If you want a book that treats the learning process as the subject and Python as the worked example, this repository is the one that does that, and the official tutorial does not attempt it.

Maintenance, licensing and what it costs to keep using

The last push was on 2026-05-20. That is recent enough that the repository is not abandoned, but the book does not carry a maintenance promise. There are no releases, no changelog and no stated compatibility target, so an upgrade is not something you schedule. You pull and you read.

The practical cost is therefore in the reader's environment, not the repository's. JupyterLab moves faster than a book does, and the appendix notebook that covers installation is itself a document that can fall behind the install it describes. The README does not say when that appendix was last revised, and it does not name a JupyterLab version.

On licensing: the README states the book uses the CC-BY-NC-ND license and links to the 3.0 deed. Attribution, non-commercial use and no derivatives are the three conditions, and the no-derivatives clause is the one that matters most for anyone thinking about reuse. This is a description of what the repository says, not legal advice; if you plan to redistribute, translate or teach from the text commercially, read the deed itself and get your own answer.

Editorial conclusion

Adopt it if you read Chinese and want a structured, opinionated path from zero Python to functions, classes, tests and regular expressions, with a separate appendix that walks through installing JupyterLab and VS Code. Do not adopt it if you need English prose, permissive licensing for reuse, or a maintained software dependency; the repository is a book, not a package. Before committing, open T-appendix.jupyter-installation-and-setup.ipynb first, since the README asks readers to read it before anything else, and check the CC-BY-NC-ND terms against whatever you intend to do with the text.

Frequently asked questions

What is self-teaching in the-craft-of-selfteaching?

The repository presents it as a skill with a loop rather than a talent: its README shows pseudo-code where you learn and practice until you can create something, then start again on a new subject. The book's thesis is stated in its subtitle, that a person without the ability to teach themselves has no future.

How does the-craft-of-selfteaching approach learning to code as a self-taught beginner?

It treats coding as the entry point for self-teaching and builds a Python curriculum around it, running from values and control flow through functions, modules, test-driven development, classes, decorators and regular expressions. Part.1.B.why.start.from.learning.coding.ipynb is the chapter that argues for that choice.

Do I need to install anything to read the-craft-of-selfteaching?

No. The README added a markdown/ directory in March 2019 so the book could be read as plain text. For the intended experience the README asks readers to first read T-appendix.jupyter-installation-and-setup.ipynb and install JupyterLab locally.

What license does the-craft-of-selfteaching use?

The README states the book is under the CC-BY-NC-ND license and links to the 3.0 deed. That means attribution, non-commercial use only, and no derivative works.

How can I contribute corrections to the-craft-of-selfteaching?

The README directs contributors to read 02.proof-of-work.ipynb first, which explains how to use a pull request to proofread the book. That same notebook is the one that asks readers to demonstrate they actually read the material.

Official sources

  1. Issues
  2. README
  3. xiaolai/the-craft-of-selfteaching on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/xiaolai-the-craft-of-selfteaching.svg)](https://hysenlabs.com/projects/xiaolai-the-craft-of-selfteaching)