The Python 3 Standard Library by Example

Rs. 4,025
  • Author: Hellmann Doug
  • ISBN: 9789386873507
  • Publisher: Pearson Education
  • Publication Date: August 16, 2017
  • Format: Paperback – 1464 pages
  • Language: English

Out of stock



Share
Description

Master the Powerful Python 3 Standard Library through Real Code Examples

The Python 3 Standard Library contains hundreds of modules for interacting with the operating system, interpreter, and Internet-all extensively tested and ready to jump-start application development. Now, Python expert Doug Hellmann introduces every major area of the Python 3.x library through concise source code and output examples. Hellmann’s examples fully demonstrate each feature and are designed for easy learning and reuse.

You’ll find practical code for working with text, data structures, algorithms, dates/times, math, the file system, persistence, data exchange, compression, archiving, crypto, processes/threads, networking, Internet capabilities, email, developer and language tools, the runtime, packages, and more. Each section fully covers one module, with links to additional resources, making this book an ideal tutorial and reference.

The Python 3 Standard Library by Example introduces Python 3.x’s new libraries, significant functionality changes, and new layout and naming conventions. Hellmann also provides expert porting guidance for moving code from 2.x Python standard library modules to their Python 3.x equivalents.

Key Features
  • Manipulate text with string, textwrap, re (regular expressions), and difflib
  • Use data structures: enum, collections, array, heapq, queue, struct, copy, and more
  • Implement algorithms elegantly and concisely with functools, itertools, and contextlib
  • Handle dates/times and advanced mathematical tasks
  • Archive and data compression
  • Understand data exchange and persistence, including json, dbm, and sqlite
  • Sign and verify messages cryptographically
  • Manage concurrent operations with processes and threads
  • Test, debug, compile, profile, language, import, and package tools
  • Control interaction at runtime with interpreters or the environment
Review

“The genius of Doug’s approach is that with 15 minutes per week, any motivated programmer can learn the Python Standard Library. Doug’s guided tour will help you flip the switch to fully power-up Python’s batteries.” – Raymond Hettinger, Distinguished Python Core Developer

Table of Contents
  1. Cover Page
  2. About This E-Book
  3. Title Page
  4. Copyright Page
  5. Dedication Page
  6. Contents at a Glance
  7. Contents
  8. Introduction
  9. This Book’s Target Audience
  10. Python 3 Versus 2
  11. How This Book Is Organized
  12. Downloading the Example Code
  13. Acknowledgments
  14. About the Author
  15. Chapter 1. Text
    1. string: Text Constants and Templates
    2. textwrap: Formatting Text Paragraphs
    3. re: Regular Expressions
    4. difflib: Compare Sequences
  16. Chapter 2. Data Structures
    1. enum: Enumeration Type
    2. collections: Container Data Types
    3. array: Sequence of Fixed-Type Data
    4. heapq: Heap Sort Algorithm
    5. bisect: Maintain Lists in Sorted Order
    6. queue: Thread-Safe FIFO Implementation
    7. struct: Binary Data Structures
    8. weakref: Impermanent References to Objects
    9. copy: Duplicate Objects
    10. pprint: Pretty-Print Data Structures
  17. Chapter 3. Algorithms
    1. functools: Tools for Manipulating Functions
    2. itertools: Iterator Functions
    3. operator: Functional Interface to Built-In Operators
    4. contextlib: Context Manager Utilities
  18. Chapter 4. Dates and Times
    1. time: Clock Time
    2. datetime: Date and Time Value Manipulation
    3. calendar: Work with Dates
  19. Chapter 5. Mathematics
    1. decimal: Fixed- and Floating-Point Math
    2. fractions: Rational Numbers
    3. random: Pseudorandom Number Generators
    4. math: Mathematical Functions
    5. statistics: Statistical Calculations
  20. Chapter 6. The File System
    1. os.path: Platform-Independent Manipulation of Filenames
    2. pathlib: File System Paths as Objects
    3. glob: Filename Pattern Matching
    4. fnmatch: Unix-Style Glob Pattern Matching
    5. linecache: Read Text Files Efficiently
    6. tempfile: Temporary File System Objects
    7. shutil: High-Level File Operations
    8. filecmp: Compare Files
    9. mmap: Memory-Map Files
    10. codecs: String Encoding and Decoding
    11. io: Text, Binary, and Raw Stream I/O Tools
  21. Chapter 7. Data Persistence and Exchange
    1. pickle: Object Serialization
    2. shelve: Persistent Storage of Objects
    3. dbm: Unix Key-Value Databases
    4. sqlite3: Embedded Relational Database
    5. xml.etree.ElementTree: XML Manipulation API
    6. csv: Comma-Separated Value Files
  22. Chapter 8. Data Compression and Archiving
    1. zlib: GNU zlib Compression
    2. gzip: Read and Write GNU zip Files
    3. bz2: bzip2 Compression
    4. tarfile: Tar Archive Access
    5. zipfile: ZIP Archive Access
  23. Chapter 9. Cryptography
    1. hashlib: Cryptographic Hashing
    2. hmac: Cryptographic Message Signing and Verification
  24. Chapter 10. Concurrency with Processes, Threads, and Coroutines
    1. subprocess: Spawning Additional Processes
    2. signal: Asynchronous System Events
    3. threading: Manage Concurrent Operations Within a Process
    4. multiprocessing: Manage Processes Like Threads
    5. asyncio: Asynchronous I/O, Event Loop, and Concurrency Tools
    6. concurrent.futures: Manage Pools of Concurrent Tasks
  25. Chapter 11. Networking
    1. ipaddress: Internet Addresses
    2. socket: Network Communication
    3. selectors: I/O Multiplexing Abstractions
    4. select: Wait for I/O Efficiently
    5. socketserver: Creating Network Servers
  26. Chapter 12. The Internet
    1. urllib.parse: Split URLs into Components
    2. urllib.request: Network Resource Access
    3. urllib.robotparser: Internet Spider Access Control
    4. base64: Encode Binary Data with ASCII
    5. http.server: Base Classes for Implementing Web Servers
    6. http.cookies: HTTP Cookies
    7. webbrowser: Displays Web Pages
    8. uuid: Universally Unique Identifiers
    9. json: JavaScript Object Notation
    10. xmlrpc.client: Client Library for XML-RPC
    11. xmlrpc.server: An XML-RPC Server
  27. Chapter 13. Email
    1. smtplib: Simple Mail Transfer Protocol Client
    2. smtpd: Sample Mail Servers
    3. mailbox: Manipulate Email Archives
    4. imaplib: IMAP4 Client Library
  28. Chapter 14. Application Building Blocks
    1. argparse: Command-Line Option and Argument Parsing
    2. getopt: Command-Line Option Parsing
    3. readline: The GNU readline Library
    4. getpass: Secure Password Prompt
    5. cmd: Line-Oriented Command Processors
    6. shlex: Parse Shell-Style Syntaxes
    7. configparser: Work with Configuration Files
    8. logging: Report Status, Error, and Informational Messages
    9. fileinput: Command-Line Filter Framework
    10. atexit: Program Shutdown Callbacks
    11. sched: Timed Event Scheduler
  29. Chapter 15. Internationalization and Localization
    1. gettext: Message Catalogs
    2. locale: Cultural Localization API
  30. Chapter 16. Developer Tools
    1. pydoc: Online Help for Modules
    2. doctest: Testing Through Documentation
    3. unittest: Automated Testing Framework
    4. trace: Follow Program Flow
    5. traceback: Exceptions and Stack Traces
    6. cgitb: Detailed Traceback Reports
    7. pdb: Interactive Debugger
    8. profile and pstats: Performance Analysis
    9. timeit: Time the Execution of Small Bits of Python Code
    10. tabnanny: Indentation Validator
    11. compileall: Byte-Compile Source Files
    12. pyclbr: Class Browser
    13. venv: Create Virtual Environments
    14. ensurepip: Install the Python Package Installer
  31. Chapter 17. Runtime Features
    1. site: Site-Wide Configuration
    2. sys: System-Specific Configuration
    3. os: Portable Access to Operating System–Specific Features
    4. platform: System Version Information
    5. resource: System Resource Management
    6. gc: Garbage Collector
    7. sysconfig: Interpreter Compile-Time Configuration
  32. Chapter 18. Language Tools
    1. warnings: Non-fatal Alerts
    2. abc: Abstract Base Classes
    3. dis: Python Byte-Code Disassembler
    4. inspect: Inspect Live Objects
  33. Chapter 19. Modules and Packages
    1. importlib: Python’s Import Mechanism
    2. pkgutil: Package Utilities
    3. zipimport: Load Python Code from ZIP Archives
  34. Appendix A. Porting Notes
  35. A.1 References
  36. A.2 New Modules
  37. A.3 Renamed Modules
  38. A.4 Removed Modules
  39. A.5 Deprecated Modules
  40. A.6 Summary of Changes to Modules
  41. Appendix B. Outside of the Standard Library
  42. B.1 Text
  43. B.2 Algorithms
  44. B.3 Dates and Times
  45. B.4 Mathematics
  46. B.5 Data Persistence and Exchange
  47. B.6 Cryptography
  48. B.7 Concurrency with Processes, Threads, and Coroutines
  49. B.8 The Internet
  50. B.9 Email
  51. B.10 Application Building Blocks
  52. B.11 Developer Tools
  53. Index of Python Modules
  54. Index
  55. Code Snippets
Author Biography

Doug Hellmann is a Senior Principal Software Engineer at Red Hat, working on OpenStack. He has been programming in Python since version 1.4, and has worked on a variety of Unix and non-Unix platforms for projects in fields such as mapping, medical news publishing, banking, and data center automation. In addition to his involvement with the OpenStack community, Doug is a Fellow of the Python Software Foundation, and served as its Communications Director from 2010-2012. After a year as a regular columnist for Python Magazine, he served as Editor-in-Chief from 2008-2009. Doug published the popular “Python Module of the Week” series on his blog. He lives in Athens, Georgia, USA with his wife and cats.

Additional information
Weight1.696 kg
Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.