Guides
In-depth tutorials and guides for Python developers.
Build a CSV Data Analyzer
Learn to read, filter, aggregate, and write CSV data in Python using the standard library csv module — no third-party dependencies required.
Build a Markdown to HTML Converter in Python
Learn how to convert Markdown to HTML in Python using mistune and markdown, add syntax highlighting with Pygments, and sanitize output to prevent XSS attacks.
Build a Text Adventure Game
Create an interactive fiction game in Python using dictionaries, loops, and input handling. A step-by-step guide for beginners.
Python Number Guessing Game — Your First Beginner Project
Learn Python by building an interactive number guessing game. Covers variables, conditionals, loops, try/except, random.randint(), input(), and int().
Build a CLI To-Do App in Python
Learn how to build a command-line to-do app using Python's argparse module and JSON persistence.
Build a File Organizer Script
Learn how to write a Python script that automatically organizes files by extension, pattern, or date using pathlib, shutil, and glob.
Build a Password Generator in Python
Learn to generate cryptographically secure passwords and memorable passphrases using Python's secrets module with clear examples.
Modern Python Workflow with Rye and uv
Learn how uv replaces pip, venv, and more for fast Python project and package management, and what to do with an existing Rye project.
Watching File Changes with watchfiles
A practical guide to monitoring file system changes with Python's watchfiles library — covering the full API, filters, debouncing, and hot reloading workflows.
Running Python Apps with Granian
Learn how to use Granian, a Rust-based HTTP server for Python ASGI, RSGI, and WSGI applications with native HTTP/2 and WebSocket support.
Result Types and Error Handling Without Exceptions
Learn how to handle errors in Python using Result types — a functional programming pattern inspired by Rust that avoids exceptions.
SQLModel: SQLAlchemy Meets Pydantic
Learn how SQLModel unifies SQLAlchemy ORM and Pydantic validation in a single Python model class, with easy FastAPI integration.
How to Check if a String is a Number in Python
Learn multiple ways to check if a string contains a number in Python. Includes examples for integers, floats, and handling edge cases.
Distributed Computing with Dask
Learn how to scale your Python computations across multiple machines using Dask's distributed computing capabilities.
Fast Serialisation with msgspec
Learn how msgspec provides high-performance serialization with zero-copy decoding and built-in validation for Python applications.
Getting Started with Polars
A practical guide to Polars, the fast DataFrame library for Python. Learn to create DataFrames, run queries, and use lazy execution.
Building Terminal UIs with Textual
Learn how to build rich terminal user interfaces in Python using the Textual framework. Covers widgets, layouts, CSS styling, and practical examples.
attrs vs dataclasses: A Practical Comparison
Compare Python attrs and dataclasses side-by-side—understand when to use the stdlib option versus the third-party library with more features.
Runtime Type Checking with beartype
Add runtime type safety to your Python functions with beartype—the fast, decorator-based type checker that catches type errors before they reach production.
Advanced Structural Pattern Matching
Go beyond match/case basics. Explore mapping patterns, nested structures, custom classes, and state machines.
Base64 Encoding and Decoding in Python
Learn how to encode and decode Base64 data in Python using the base64 module, with practical examples.
Building CLIs with Click
Learn how to create command-line interfaces in Python using Click, a composable and ergonomic library.
Context Variables with contextvars
Learn how to use contextvars for thread-local and task-local state in async Python. Covers ContextVar, copy_context(), and practical patterns.
Message Authentication with hmac
Learn how to use Python's hmac module to create and verify keyed-hash message authentication codes (HMAC) for data integrity and authentication.
Dynamic Imports with importlib
Learn to dynamically import modules and access attributes at runtime using Python's importlib.
ProcessPoolExecutor and Pool in Python
Learn how to use ProcessPoolExecutor and Pool to parallelize CPU-bound tasks. Covers pool management, mapping, and common patterns.
Thread-Safe Queues with queue.Queue
Learn how to use Python queue.Queue for thread-safe communication between threads. Covers FIFO, LIFO, and priority queues with practical examples.
Python Security Best Practices
Protect your Python apps from common vulnerabilities. Learn input validation, secure data handling, authentication, and defense-in-depth strategies.
SSL/TLS Connections with the ssl Module
Learn how to use Python's ssl module to create secure network connections, verify certificates, and configure TLS contexts for production use.
Trio vs asyncio: Structured Concurrency in Python
Compare Trio and asyncio for async Python. Learn when structured concurrency matters and which library fits your project.
Processing CSV Files in Python
Learn how to read, write, and process CSV files in Python using the csv module and pandas.
Building APIs with FastAPI
Learn how to create REST APIs quickly with FastAPI, from basic endpoints to parameterized routes and data validation with Pydantic.
Making HTTP Requests with httpx
Learn how to make HTTP requests in Python using httpx—a modern library supporting both sync and async APIs, HTTP/2, and a requests-compatible interface.
Subplots and Layouts in Matplotlib
Learn how to create multiple plots in a single figure using subplots, gridspec, and layout engines.
NumPy Arrays: The Complete Guide
Master NumPy arrays: creation, indexing, slicing, and operations for efficient numerical computing.
pandas DataFrames Explained
Master pandas DataFrames: creation, indexing, manipulation, and analysis of tabular data in Python.
pandas groupby: Split, Apply, Combine
Master pandas groupby operations to split data into groups, apply functions, and combine results for powerful data analysis.
Profiling and Optimizing Python Code
Learn how to identify performance bottlenecks in your Python code using profilers, and apply proven optimization techniques to make your programs run faster.
Data Validation with Pydantic in Python
Learn how to use Pydantic to validate data, define schemas, and create robust data models in your Python applications.
Understanding pyproject.toml
Learn how to configure Python projects using pyproject.toml, the modern standard for project metadata.
Abstract Base Classes in Depth
Master Python ABCs—explore advanced patterns like abstract properties, classmethods, virtual subclasses, and when to choose ABCs over Protocols.
Understanding Python Bytecode
Learn what Python bytecode is, how the interpreter compiles your code, and how to inspect and optimize by understanding what happens under the hood.
csv.DictReader and csv.DictWriter
Learn how to read and write CSV files using dictionaries with Python's csv.DictReader and csv.DictWriter classes.
Customising pickle with copyreg
Learn how to use Python's copyreg module to register custom picklers and reducers for classes, making them serializable with pickle.
Managing Config with python-dotenv
Learn how to use python-dotenv to manage environment variables in Python, keeping your configuration separate from your code.
The GIL Explained
Understand Python Global Interpreter Lock (GIL), why it exists, and how to work around its limitations for true parallelism.
Hashing with hashlib
Learn how to use Python's hashlib module to compute cryptographic hashes, checksums, and digests for data integrity and security.
Working with IP Addresses in Python
Learn how to create, validate, and manipulate IPv4 and IPv6 addresses using Python built-in ipaddress module.
Python's Memory Model and Reference Counting
Understand how Python manages memory internally—explore reference counting, the garbage collector, and how to write memory-efficient code.
Operator Overloading in Python
Learn how to define custom behavior for Python operators in your classes using special methods like __add__, __mul__, __eq__, and more
Properties: @property, getter and setter
Learn how to use the @property decorator in Python to create managed attributes with getter, setter, and deleter methods.
Generating Secrets with the secrets Module
Learn how to generate cryptographically secure random numbers, tokens, and passwords using Python's secrets module.
Persistent Storage with shelve
Learn how to use the shelve module for simple persistent key-value storage in Python applications.
Template Strings with string.Template
Learn how to use Python's string.Template class for simple, safe string substitution without the complexity of f-strings or .format().
Creating and Extracting Archives with tarfile
Learn how to create, read, and extract tar archives using Python's tarfile module with practical examples.
Generic Types and TypeVar in Python
Master Python generics with TypeVar, Generic, and parametric polymorphism to write flexible, type-safe code that works with any data type.
Compressing Data with zlib
Learn how to compress and decompress data using Python's zlib module, the foundation for gzip and other compression formats.
Working with JSON in Python
Learn how to read, write, and manipulate JSON data in Python using the json module.
Making HTTP Requests with requests
Learn how to make HTTP requests in Python using the requests library—GET, POST, headers, and error handling.
Beautiful Terminal Output with Rich
Learn how to create stunning terminal output in Python using the Rich library, including colored text, tables, progress bars, and more.
Building CLIs with Typer
Learn how to create elegant command-line interfaces in Python using Typer, built on Click and type hints.
Python Virtual Environments
Learn how to create and manage isolated Python environments for your projects.
Web Scraping with BeautifulSoup
Learn the fundamentals of web scraping in Python using BeautifulSoup—parsing HTML, navigating the DOM, and extracting data.
Abstract Base Classes with abc
Learn how to use Python abc module to define abstract base classes that enforce method implementation in subclasses
Async/Await Patterns in Python
Master async/await patterns in Python—retry logic, timeouts, batching, and error handling for production async code.
The Descriptor Protocol
Learn how Python descriptors let you customize attribute access, create reusable property logic, and build more expressive classes.
Getting Started with asyncio
Learn asyncio basics—Python's library for async code. Covers coroutines, the event loop, and running concurrent operations.
Building CLI Tools with argparse
Learn how to create command-line interfaces in Python using the argparse module.
Working with Environment Variables in Python
Learn how to read, write, and manage environment variables in your Python applications.
Python Logging for Beginners
Learn how to use Python logging effectively for debugging and monitoring your applications.
Logging Best Practices in Python
Take your Python logging to the next level with advanced configuration, handlers, structured logging, and production-ready patterns.
Multiprocessing in Python
Learn how to use Python multiprocessing to run code in parallel using multiple processes. Covers Process, Pool, shared memory, and synchronization.
Mocking in pytest
Learn how to replace real objects with mocks in pytest to isolate code under test, control dependencies, and test edge cases.
Structural Subtyping with Protocol
Learn how Protocol classes in Python enable structural subtyping, letting you define interfaces without inheritance for flexible duck typing
Getting Started with pytest
Learn how to write and run tests with pytest, the most popular testing framework in Python. Cover fixtures, assertions, and best practices.
Recipes with itertools
Practical patterns and recipes for working with Python's itertools module for efficient iteration.
Understanding Metaclasses in Python
Dive deep into Python metaclasses—understand what they are, how they work, and when to use them to control class creation.
Regular Expressions with the re Module
Learn to use Python regular expressions for pattern matching, searching, and text manipulation.
Running External Commands with subprocess
Learn how to run external commands from Python, handle their output, and manage process lifecycles effectively.
SQLite in Python with the sqlite3 Module
Learn how to create, query, and manage SQLite databases using Python's built-in sqlite3 module.
Threading in Python
Learn how to use Python threading for concurrent execution. Covers Thread, Lock, Queue, and practical patterns for I/O-bound tasks.
Unit Testing with unittest
Learn Python built-in unittest framework for writing and running unit tests. Covers TestCase, assertions, fixtures, and test organization.
Python Enums: The enum Module
Learn how to use Python enums to create sets of named constants with type safety and semantic meaning.
f-strings: Python's String Formatting Power Tool
Learn how to use f-strings for readable, efficient string formatting in Python.
Functional Programming Patterns in Python
Learn functional programming patterns in Python: higher-order functions, map/filter/reduce, lambdas, comprehensions, and more.
A Practical Guide to functools.lru_cache in Python
Learn how to use lru_cache to memoize function results and speed up your Python code with practical examples.
Structural Pattern Matching with match/case
Learn how to use Python's match/case statements for powerful pattern matching. Covers literals, wildcards, or patterns, and class patterns.
File Paths with pathlib
Learn how to work with file paths elegantly using Python's pathlib module.
Closures and Variable Scoping in Python
Learn how closures work in Python, understand variable scope, and see practical examples.
Building APIs with Litestar
A practical guide to building REST APIs with Litestar, covering route handlers, request validation, dependency injection, and application structure.
Using namedtuple and NamedTuple in Python
Learn how to create lightweight, immutable record types using namedtuple and NamedTuple from the Python standard library.
Using __slots__ for Memory Efficiency in Python
Learn how __slots__ can reduce memory usage and improve attribute access speed in your Python classes.
Type Hints in Python
Learn how to add type hints to your Python code for better readability and tooling support.
Sorting in Python: The key= Parameter
Learn how to use Python's key parameter for custom sorting with sorted() and list.sort(). Covers lambda functions, itemgetter, attrgetter, and multiple keys.
The Walrus Operator (:=) in Practice
Learn Python walrus operator for assigning values in expressions. Covers list comprehensions, while loops, and common patterns.
Context Managers and the with Statement
Learn how Python's with statement and context managers handle resource cleanup reliably, with class-based and decorator-based examples
Controlling Docker from Python
Learn how to use the Docker SDK for Python to automate container management, including listing, running, building, and managing containers.
Reading and Writing YAML in Python
Learn how to read and write YAML files in Python using the PyYAML library, with examples for configuration files, nested data, and safe loading
Error Handling with try/except
Learn how to handle errors gracefully in Python with try/except blocks, multiple exceptions, else/finally, and best practices.
List Comprehensions in Python
Learn how to use list comprehensions to create lists concisely, with examples of filtering, nested loops, and when to prefer a regular for loop.
Getting Started with Dataclasses
Learn how to use Python dataclasses to write cleaner, more maintainable classes for storing data — with examples of defaults, immutability, and validation
Python Decorators Explained
Learn how decorators work in Python, from basic function wrappers to parameterized decorators with practical examples for timing, logging, and caching
Virtual Environments and pip
Learn how to create isolated Python environments with venv and manage dependencies with pip — essential skills for any Python project
Working with Files in Python
Learn how to read from and write to files in Python using built-in functions like open(), read(), write(), and context managers.
Building a TCP Server and Client in Python
Learn how to build TCP servers and clients in Python using the socket module, with threading for multiple connections.
Understanding Python Generators
A complete guide to generators, yield expressions, and building memory-efficient data pipelines in Python