Open-source project
realpython/materials avatar
realpython/materials

Real Python Materials: The Code Repository Behind Every Tutorial

Bonus materials, exercises, and example projects for our Python tutorials

5,209 stars5,273 forksJupyter NotebookMIT

At a glance

What is it?
realpython/materials is a public GitHub repository holding the sample code, exercises, and example projects for all tutorials published on Real Python. It is organized so that each tutorial owns a dedicated folder, and Ruff enforces consistent code style across the entire collection.
Who is it for?
Python learners who follow Real Python tutorials should clone this repository rather than copying code snippets manually from the articles. Instructors and Real Python contributors who want to submit code for a new tutorial must match the Ruff configuration pinned in requirements.txt.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day 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 30, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What realpython/materials Contains and Who It Is For

realpython/materials is the companion code repository for Real Python, a Python learning platform. The README describes it as holding 'bonus materials, exercises, and example projects for Real Python's Python tutorials.' It exists because web articles cannot embed interactive code runners directly, so the repository gives readers a way to run the actual code from a tutorial on their own machine.

The audience has two groups. Readers of Real Python articles use the repository to download working code for a tutorial they are following. Contributors and staff at Real Python use it as the place to push sample code when publishing a new tutorial. The repository is MIT licensed and publicly accessible, but the tutorials themselves are on realpython.com, not in this repository.

The primary language listed in the repository metadata is Jupyter Notebook, which reflects the many data science and analysis tutorials in the collection. The top-level directory listing shows a wide range of tutorial topics: asyncio, Django, data analysis, machine learning, web scraping, and command-line tools, among many others.

Repository Layout: One Folder per Tutorial

The repository has no nested module structure shared across tutorials. Each tutorial gets a top-level folder named after the tutorial's subject. The folder names in the repository root include examples such as asyncio-walkthrough/, build-a-blog-from-scratch-django/, data-analysis/, and django-migrations/.

This flat layout means there are no cross-tutorial imports. Each folder is self-contained. The advantage is that a reader can clone the repository and work only in the folder for the article they are reading without needing to understand the rest of the structure. The disadvantage is that common utilities are not shared between tutorials; each folder repeats whatever setup code it needs.

The pyproject.toml at the repository root configures Ruff with target-version set to py314 and line-length set to 79. Several folders are excluded from Ruff's checks, including .devcontainers/, .github/, migrations/, and specific files that the README lists by path. These exclusions cover generated code and directories where PEP 8 formatting is not the primary concern.

Cloning the Repository and Running a Sample Project

The README does not give a generic install command for the repository as a whole, because each tutorial folder has its own dependencies. The general workflow is to clone the repository, navigate to the tutorial folder, and follow the instructions in the corresponding article on realpython.com.

Contributors and staff use Ruff for code style validation. The README gives the commands for checking code before submission:

sh
$ ruff format --check
$ ruff check

To auto-fix formatting:

sh
$ ruff format
$ ruff check --fix

The README specifies that contributors must use the exact Ruff version from requirements.txt. The requirements.txt in the repository root contains:

code
ruff==0.14.1

Installing this pinned version ensures that the formatting rules applied locally match what the CI system checks. Using a different Ruff version can produce different formatting decisions, which would cause CI to reject the contribution.

Coverage Across Python Topics

The folder list in the repository root spans a broad range of Python tutorial subjects. Web frameworks appear with Django and Flask examples. Asynchronous programming appears in asyncio-walkthrough/ and celery-async-tasks/. Data tooling appears in data-analysis/ and altair-python/. AI-related examples appear in newer folders such as agents-md/, crewai-python/, claude-api-python/, and codex-cli/.

The Jupyter Notebook classification as the primary language reflects data science and analysis tutorials, but the majority of folders contain plain Python scripts rather than notebooks. The pyproject.toml targets py314, which indicates the repository includes examples for Python 3.14 features.

The devcontainer configuration in .devcontainer/ suggests that at least some tutorials are designed to run in a container without local setup. The README does not document which tutorials use the devcontainer.

What the Repository Does Not Provide

realpython/materials is a reference implementation repository, not an interactive learning platform. It has no automated grading system, no progress tracking, and no exercise prompts with expected outputs. The exercises described in the Real Python articles are in the articles themselves; the repository holds the solution code.

The README explicitly says the team cannot provide one-to-one support via GitHub. Support is available through Real Python's Office Hours calls and community Slack. This means opening an issue on the repository expecting a code explanation or debug help from Real Python staff is not the intended workflow.

The repository also does not contain the tutorial text. Someone who clones the repository without access to the corresponding Real Python article may find the code unintelligible because there is no explanation of what each file does or why it is structured the way it is.

Real Python Materials vs Official Python Documentation Examples

The Python documentation at docs.python.org includes code examples inline in the text, but does not maintain a separate downloadable repository of tutorial companion code. The standard library documentation examples are minimal and focused on demonstrating a single function or class, not on building a working application.

realpython/materials is broader in scope because the tutorials are application-level: the repository contains working Django apps, async pipelines, and CLI tools, not isolated function demonstrations. The Python documentation examples are embedded in HTML and are not meant to be run as projects. The trade-off is that the Python documentation is the authoritative reference for language features, while realpython/materials provides the full project context that a documentation example cannot.

A closer alternative is the official Python packaging documentation samples repository or repositories like practical-python, which also provide structured code examples for learning. The difference from realpython/materials is that Real Python's collection is synchronized to a commercial tutorial platform with written articles, which means the code always has an accompanying explanation.

Maintenance Status and License

The last push to the repository was on 2026-09-26. The repository has no GitHub releases. Version management is by direct push to the master branch as tutorials are published.

The license is MIT. Tutorial code can be copied and used in other projects without attribution requirements under the MIT terms, though the articles themselves on realpython.com are subject to separate copyright.

The CI system uses GitHub Actions, as the README badge indicates. The action runs Ruff in check mode on every push. The build status badge in the README links to the GitHub Actions workflow. The .github/ directory in the repository root holds the workflow definitions.

Editorial conclusion

Python learners who follow Real Python tutorials should clone this repository rather than copying code snippets manually from the articles. Instructors and Real Python contributors who want to submit code for a new tutorial must match the Ruff configuration pinned in requirements.txt. The repository is not a standalone course or an interactive learning platform; it only makes sense alongside the corresponding article on realpython.com. Teams looking for a structured Python curriculum with exercises and automated grading should look elsewhere, because this repository provides reference implementations, not graded exercises.

Frequently asked questions

How do I find the code for a specific Real Python tutorial?

Clone the realpython/materials repository and look for a top-level folder whose name matches the tutorial topic. Each tutorial has its own directory with the sample code. The folder name corresponds to the article on realpython.com.

What version of Ruff does the Real Python Materials repository require?

The requirements.txt in the repository root pins ruff==0.14.1. The README instructs contributors to use this exact version to match the CI checks, because different Ruff versions can produce different formatting decisions.

Can I use Real Python Materials code in my own projects?

Yes. The repository is MIT licensed, which permits copying, modifying, and using the code in other projects, including commercial ones, without restriction. The articles on realpython.com are under separate copyright.

Official sources

  1. Issues
  2. License: MIT
  3. Project website
  4. README
  5. realpython/materials 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/realpython-materials.svg)](https://hysenlabs.com/projects/realpython-materials)