Skip to main content

7.1 Standard Library and Tooling Tour

Python’s standard library provides production-ready modules for common engineering tasks.

OS and filesystem

  • os and shutil for paths, process interactions, and file operations
  • glob for wildcard expansion

CLI and process behavior

  • sys.argv for raw CLI arguments
  • argparse for robust command-line interfaces
  • sys.stderr and sys.exit() for error and termination behavior

Text, math, and data utilities

  • re for regular expressions
  • math, random, statistics for numeric work
  • datetime for date/time operations

Compression and data exchange

  • gzip, bz2, lzma, zipfile, tarfile
  • json, csv, sqlite3

Testing and quality

  • doctest for executable doc examples
  • unittest for structured unit test suites

Official references