Python Standard Library Wrap-Up — 17 Modules Across 7 Categories

Survey 17 standard library modules across 7 categories, plus the judgment criteria for switching to external libraries — urllib→requests, csv→pandas, math→NumPy, unittest→pytest.

The big picture — 17 standard library modules

Python's standard library is the set of modules built into Python — no install required. This series covered 17 of the most useful ones. We started with pulling info from the runtime environment and worked up the abstraction ladder through numbers, strings, data I/O, data structures, ops, and concurrency.

The standard library in 7 categories
Concurrency / parallelismasyncio / threadingmultiprocessingResource mgmt / opscontextlibloggingData structure extensionscollections / itertoolsdataclassesData I/Ojson / csvpickle / hashlibRuntime and filessys / argparseos / pathlibNumbers / dates / randomdatetime / mathrandom / secretsStrings / textre / stringtextwrap / pprint
The standard library organized into 7 categories. Stack from the bottom upruntime / numbers / strings as the foundation, data I/O and data structures in the middle, ops and concurrency on top.

Articles by category

Here's the article list for each category, with the kinds of problems each one solves.

CategoryArticlesTypical problems it solves
Runtime and filessys-argparse / os-pathlib / shutil-tempfileCLI arguments, path manipulation, bulk file operations
Numbers / dates / randomdatetime-time / math-statistics / decimal-fractions / random-secretsDate math, exact monetary calculations, random numbers and tokens
Strings / textre / string-textwrap / pprintRegex, template substitution, pretty-printing
Data I/Ojson-csv / pickle-base64 / hashlibStructured data, serialization, encoding, hashing
Data structure extensionscollections / itertools-functools / enum-dataclassesAggregation, combinations, function tweaks, named constants, data classes
Resource mgmt / opscontextlib / loggingCustom with blocks, logging
Concurrency / parallelismasyncio-basics / asyncio-tasks / threading-multiprocessingConcurrent execution, parallel computation, calling external commands

What's an external library?

External libraries are packages that don't ship with Python — you install them with pip install <library>. They tend to be specialized for specific use cases like web frameworks, data analysis, and machine learning, and are published by communities or companies.

Standard library vs. external library
Standard library(json / csv / re, ...)Bundled with Pythonimport and use right awayExternal library(pandas / requests, ...)Install via pip installthen import to use
Standard library ships with Python — import and you're ready to go. External library is a specialized package you install with pip install first, then import like any other module.

Standard library and external library — how they relate

The standard library is your first stop, but for larger projects there are areas where external libraries are simply easier to work with. Pick up the concepts in the standard library first, then move outward — the design ideas carry over (pandas extends csv, requests is a friendlier urllib.request, pytest is unittest's improved cousin), so the learning curve flattens.

Main upgrade paths from standard library to external
Standardurllib.requestExternalrequests / httpxStandardcsv / collectionsExternalpandas / polarsStandardmath / statisticsExternalNumPy / SciPyStandardunittestExternalpytest
Four main paths once a project gets bigger. Standard library on the left for the foundation, external library on the right for scale.

External libraries by use case

Once the standard library is solid, pull in external libraries that match your goals. Each domain has its go-to library, so picking one representative and starting to use it is the fastest path forward.

Go-to external libraries by use case
Web developmentFastAPI / DjangoFlaskData analysispandas / NumPymatplotlibMachine learningscikit-learnPyTorch / TensorFlowHTTP requestsrequests / httpxTestingpytest
Each use case has its go-to external library. Five mainstream domains: web dev, data analysis, machine learning, HTTP, and testing.
QUIZ

Knowledge Check

Answer each question one by one.

Q1Which standard library do you use to verify the integrity of a downloaded file?

Q2What's the most concise way to count how many times each element appears in a list?

Q3When you need to go beyond what csv can handle and do serious data analysis, which external library is the standard pick?