explaingit

piglei/one-python-craftsman

7,210Audience · developerComplexity · 1/5Setup · easy

TLDR

A Chinese-language series of 16 practical Python articles teaching clean code, SOLID design principles, and real engineering practices, also published as a physical book.

Mindmap

mindmap
  root((one-python-craftsman))
    Topics
      Naming and clarity
      Conditionals
      Data structures
      Decorators
      Exception handling
    OOP principles
      SOLID design
      Single responsibility
      Open-closed
      Decoupling
    Format
      Blog article series
      Physical book
      Community web mirror
    Audience
      Chinese Python developers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Study Python best practices in Chinese, covering naming, conditionals, data structures, decorators, and exception handling with real examples.

USE CASE 2

Learn how to apply SOLID design principles to Python code through before-and-after refactoring walkthroughs.

USE CASE 3

Use the articles as a study guide for writing cleaner, more maintainable Python in a professional context.

Tech stack

Python

Getting it running

Difficulty · easy Time to first run · 5min

Content is written in Chinese, not suitable for readers who cannot read Mandarin.

License not stated in the explanation.

In plain English

One Python Craftsman is a collection of Chinese-language articles sharing practical Python programming knowledge, written by an experienced Python developer who goes by piglei. The repository covers coding techniques, best practices, and ways of thinking about software design problems. The articles have since been expanded and published as a physical book titled Python Craftsman: Cases, Techniques and Engineering Practices. The series is organized into sixteen topics. Early articles focus on foundational choices: how to name variables clearly, how to write clean conditional branches, and how to work effectively with Python data structures like lists, dictionaries, and sets. Later articles cover function design, exception handling, loops, decorators, and how Python module imports work, including the common problem of circular imports. A substantial portion of the series is devoted to object-oriented programming principles, specifically the SOLID design principles applied to Python code. These chapters walk through common mistakes and show how to refactor code to follow rules like keeping each class responsible for a single concern, making code open to extension without modification, and decoupling high-level logic from low-level implementation details. The README is written in Chinese, and the articles themselves are also in Chinese, making this resource primarily useful for Mandarin-reading Python developers rather than a general international audience. Three chapters are available as free reading on the author book website, and the rest are in the linked GitHub files. A mirrored website built by a community contributor also hosts all the articles in a more readable format than browsing raw Markdown files on GitHub.

Copy-paste prompts

Prompt 1
Review my Python class and suggest improvements to naming, single-responsibility, and error handling following One Python Craftsman principles.
Prompt 2
Explain the SOLID open-closed principle in Python with a concrete before-and-after refactoring example in the style of One Python Craftsman.
Prompt 3
Show me how to refactor a deeply nested Python if-else block into cleaner, flatter code following the patterns from One Python Craftsman.
Prompt 4
Help me implement a Python decorator that adds timing and logging to a function, explained the way One Python Craftsman covers decorators.
Prompt 5
Walk me through avoiding circular imports in Python the way the One Python Craftsman series explains the module import system.
Open on GitHub → Explain another repo

← piglei on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.