Daniel Arbuckle's Mastering Python

Gain a thorough understanding of operating in a Python development environment, and some of the most important advanced topics with Daniel Arbuckle. This dynamic, concise book is full of real-world solutions for Python 3.6 problems, and advanced-level concepts such as reactive programming, microservices, ctypes and Cython.

Daniel Arbuckle's Mastering Python

This ebook is included in a Mapt subscription
Daniel Arbuckle

Gain a thorough understanding of operating in a Python development environment, and some of the most important advanced topics with Daniel Arbuckle. This dynamic, concise book is full of real-world solutions for Python 3.6 problems, and advanced-level concepts such as reactive programming, microservices, ctypes and Cython.
$10.00
$39.99
RRP $31.99
RRP $39.99
eBook
Print + eBook
Access every Packt eBook & Video for just $100
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Find Out More
 
Preview in Mapt

Book Details

ISBN 139781787283695
Paperback274 pages

Book Description

Daniel Arbuckle's Mastering Python covers the basics of operating in a Python development environment, before moving on to more advanced topics. Daniel presents you with real-world solutions to Python 3.6 and advanced-level concepts, such as reactive programming, microservices, ctypes, and Cython tools.

You don't need to be familiar with the Python language to use this book, as Daniel starts with a Python primer. Throughout, Daniel highlights the major aspects of managing your Python development environment, shows you how to handle parallel computation, and helps you to master asynchronous I/O with Python 3.6 to improve performance. Finally, Daniel will teach you the secrets of metaprogramming and unit testing in Python, helping you acquire the perfect skillset to be a Python expert.

Daniel will get you up to speed on everything from basic programming practices to high-end tools and techniques, things that will help set you apart as a successful Python programmer.

Table of Contents

Chapter 1: Python Primer
Python basic syntax and block structure
Python's built-in data structures and comprehensions
First-class functions and classes
The standard library
What's new in modern Python
Summary
Chapter 2: Setting Up
Downloading and installing Python
Using the command line and the interactive shell
Installing packages with pip
Finding packages in the Python Package Index
Summary
Chapter 3: Making a Package
Creating an empty package
Adding modules to the package
Accessing code from other modules
Adding static data files to the package
Summary
Chapter 4: Basic Best Practices
PEP 8 and writing readable code
Using version control
Using venv to create a stable and isolated work area
Getting the most out of docstrings
Summary
Chapter 5: Making a Command-Line Utility
Making a package executable via Python -m
Handling command-line arguments with argparse
Python tools to interact with the user
Executing other programs with subprocess
Setting up a shell script or batch file to launch the program
Summary
Chapter 6: Parallel Processing
Using the concurrent.futures package
Using the multiprocessing packages
Summary
Chapter 7: Coroutines and Asynchronous I/O
The difference between asynchronous processing and parallel processing
Using the asyncio event loop and coroutine scheduler
Awaiting data availability
Synchronizing multiple tasks
Communicating across the network
Chapter 8: Metaprogramming
Using function decorators
Function annotations
Class decorators
Metaclasses
Context managers
Descriptors
Summary
Chapter 9: Unit Testing
Understanding the principle of unit testing
Using the unittest package
Using unittest.mock
Using unittest's test discovery
Using nose for unified test discovery and reporting
Summary
Chapter 10: Reactive Programming
The concept of reactive programming
Building a simple reactive programming framework
Using the reactive extensions for Python (RxPY)
Summary
Chapter 11: Microservices
Microservices and the advantages of process isolation
Building high-level microservices with Flask
Building high-level microservices with nameko
Summary
Chapter 12: Extension Modules and Compiled Code
Advantages and disadvantages of compiled code
Accessing a dynamic library using ctypes
Interfacing with C code using Cython
Summary

What You Will Learn

  • Get to grips with the basics of operating in a Python development environment
  • Build Python packages to efficiently create reusable code
  • Become proficient at creating tools and utility programs in Python
  • Use the Git version control system to protect your development environment from unwanted changes
  • Harness the power of Python to automate other software
  • Distribute computational tasks across multiple processors
  • Handle high I/O loads with asynchronous I/O to get a smoother performance
  • Take advantage of Python's metaprogramming and programmable syntax features
  • Get acquainted with the concepts behind reactive programming and RxPy

Authors

Table of Contents

Chapter 1: Python Primer
Python basic syntax and block structure
Python's built-in data structures and comprehensions
First-class functions and classes
The standard library
What's new in modern Python
Summary
Chapter 2: Setting Up
Downloading and installing Python
Using the command line and the interactive shell
Installing packages with pip
Finding packages in the Python Package Index
Summary
Chapter 3: Making a Package
Creating an empty package
Adding modules to the package
Accessing code from other modules
Adding static data files to the package
Summary
Chapter 4: Basic Best Practices
PEP 8 and writing readable code
Using version control
Using venv to create a stable and isolated work area
Getting the most out of docstrings
Summary
Chapter 5: Making a Command-Line Utility
Making a package executable via Python -m
Handling command-line arguments with argparse
Python tools to interact with the user
Executing other programs with subprocess
Setting up a shell script or batch file to launch the program
Summary
Chapter 6: Parallel Processing
Using the concurrent.futures package
Using the multiprocessing packages
Summary
Chapter 7: Coroutines and Asynchronous I/O
The difference between asynchronous processing and parallel processing
Using the asyncio event loop and coroutine scheduler
Awaiting data availability
Synchronizing multiple tasks
Communicating across the network
Chapter 8: Metaprogramming
Using function decorators
Function annotations
Class decorators
Metaclasses
Context managers
Descriptors
Summary
Chapter 9: Unit Testing
Understanding the principle of unit testing
Using the unittest package
Using unittest.mock
Using unittest's test discovery
Using nose for unified test discovery and reporting
Summary
Chapter 10: Reactive Programming
The concept of reactive programming
Building a simple reactive programming framework
Using the reactive extensions for Python (RxPY)
Summary
Chapter 11: Microservices
Microservices and the advantages of process isolation
Building high-level microservices with Flask
Building high-level microservices with nameko
Summary
Chapter 12: Extension Modules and Compiled Code
Advantages and disadvantages of compiled code
Accessing a dynamic library using ctypes
Interfacing with C code using Cython
Summary

Book Details

ISBN 139781787283695
Paperback274 pages
Read More

Read More Reviews