From First Steps to Professional Development
Introduction: Why Python, and Where to Start
- What This Book Will Do for You
- How to Read This Book
- A Note on Learning
Chapter 1: Welcome to Python, Your First Steps
- Why Python Matters Today
- Installing Python and Verifying Your Setup
- Running Python: The Interactive Shell and Scripts
- Understanding Errors Before You Fear Them
- Choosing an Editor or IDE
- Your First Development Workflow
- Chapter Summary
Chapter 2: The Building Blocks: Variables, Types, and Operations
- Variables and Names: How Python Stores Values
- Numbers: Integers, Floats, and Complex Numbers
- Strings: Text, Formatting, and Manipulation
- Booleans and Comparison Operators
- Type Conversion and Dynamic Typing
- Arithmetic, Logical, and Bitwise Operations
- Building a Small Example: A Unit Converter
- Chapter Summary
Chapter 3: Controlling the Flow: Decisions, Loops, and Patterns
- Conditional Logic with if, elif, and else
- While Loops: Repeating Until a Condition Changes
- For Loops: Iterating Over Sequences
- List, Dict, and Set Comprehensions
- Structural Pattern Matching with match and case
- Breaking, Continuing, and Nesting Control Structures
- Building a Small Example: A Task Manager Prototype
- Chapter Summary
Chapter 4: Functions: Building Reusable Code
- Defining and Calling Functions
- Parameters, Arguments, and Default Values
- Return Values and Multiple Returns
- Variable Scope and the LEGB Rule
- *args and **kwargs: Flexible Function Signatures
- Docstrings and Documenting Your Code
- Type Hints on Functions
- Refactoring the Task Manager with Functions
- Chapter Summary
Chapter 5: Data Structures: Organizing Information
- Lists: Ordered, Mutable Sequences
- Tuples: Immutable Records and Multiple Return Values
- Dictionaries: Key-Value Mappings
- Sets: Unordered Collections of Unique Items
- The collections Module: Specialized Data Structures
- Choosing the Right Structure for the Job
- Building a Better Task Manager Data Model
- Chapter Summary
Chapter 6: Modules, Packages, and Project Organization
- Creating and Importing Modules
- Understanding the Import System
- Building Packages with init.py
- Project Layout Patterns for Real Applications
- The Standard Library: Your First Stop for Solutions
- Restructuring the Task Manager as a Package
- Chapter Summary
Chapter 7: Object-Oriented Programming: Designing with Classes
- Classes and Instances: The Basics
- Methods, Attributes, and self
- Inheritance and Method Resolution Order
- Polymorphism and Duck Typing
- Encapsulation, Properties, and Name Mangling
- Dataclasses and Modern Class Design
- Special Methods: init, str, repr, and Friends
- Chapter Summary
Chapter 8: Error Handling, Logging, and Testing
- Exceptions: Catching and Raising Errors Gracefully
- Custom Exception Classes for Domain Clarity
- The try/except/finally Pattern in Practice
- Logging: Beyond print() to Production Diagnostics
- Writing Tests with pytest
- Interactive Debugging with pdb and ipdb
- Chapter Summary
Chapter 9: File I/O, Serialization, and Working with Data
- Opening and Closing Files Safely
- Reading and Writing Text Files
- The pathlib Module for Modern Path Handling
- Working with JSON Data
- CSV and Tabular Data Processing
- Binary Files and Serialization with pickle
- Building Persistent Storage for the Task Manager
- Chapter Summary
Chapter 10: Functional Programming and Advanced Patterns
- First-Class Functions and Higher-Order Functions
- Lambda Expressions and Functional Tools
- Iterators and the Iterator Protocol
- Generators and Lazy Evaluation
- Context Managers and the with Statement
- Chapter Summary
Chapter 11: Concurrency and Asynchronous Programming
- The Global Interpreter Lock and Its Implications
- Threading for I/O-Bound Tasks
- Multiprocessing for CPU-Bound Work
- Asyncio: Cooperative Concurrency with async and await
- Building Asynchronous Applications End-to-End
- Choosing the Right Concurrency Model
- Chapter Summary
Chapter 12: Networking, APIs, and Web Development
- HTTP Fundamentals for Python Developers
- Making HTTP Requests with the requests Library
- Building a REST API with FastAPI
- Handling Authentication and API Keys
- Web Scraping and Data Extraction Basics
- Deploying Your First Web Application
- Chapter Summary
Chapter 13: Databases and Data Persistence
- Relational Database Fundamentals
- Using SQLite with the sqlite3 Module
- SQLAlchemy: The Pythonic Database Toolkit
- Database Migrations with Alembic
- Data Modeling and Schema Design Patterns
- Integrating the Task Manager with a Database
- Database Performance: Connection Pooling and Query Optimization
- Chapter Summary
Chapter 14: Type System, Code Quality, and Modern Tooling
- Python Type Hints and the typing Module
- Static Type Checking with mypy
- Code Formatting with Black and Sorting Imports
- Linting and Analysis with Ruff and flake8
- Pre-commit Hooks for Automated Quality Gates
- Integrating Tools into Your Workflow
- Generating Project Documentation with Sphinx and MkDocs
- Usage
- Chapter Summary
Chapter 15: Packaging, Deployment, and the Professional Workflow
- Virtual Environments and Dependency Isolation
- pyproject.toml and Modern Build Systems
- Publishing Packages to PyPI
- Containerization with Docker for Python Apps
- CI/CD Pipelines for Python Projects
- Security Best Practices for Python Applications
- Chapter Summary
Chapter 16: Profiling and Performance Optimization
- The Performance Workflow: Measure Before You Optimize
- CPU Profiling with cProfile
- Line-Level Profiling with line_profiler
- Memory Profiling with memory_profiler
- Statistical Profiling with Pyinstrument
- Algorithmic Complexity and Big-O Notation
- Practical Optimization Techniques
- Advanced Optimization: Cython, PyPy, and Vectorization
- When to Stop Optimizing
- Chapter Summary
Chapter 17: Design Patterns for Python
- The Guiding Principle: Simple First
- Creational Patterns: Controlling Object Creation
- Structural Patterns: Organizing Relationships
- Behavioral Patterns: Managing Communication and Logic
- When Patterns Help and When They Hurt
- Chapter Summary
Chapter 18: Data Processing, Scientific Computing, and the AI/ML Ecosystem
- Why Python Dominates Data Science
- NumPy: The Foundation of Numerical Python
- pandas: Data Manipulation and Analysis
- Data Processing Workflow: End-to-End Example
- The Machine Learning Ecosystem Overview
- Jupyter Notebooks for Interactive Exploration
- Chapter Summary

