MyInternships.in

Python Modules & Packages

Python Standard Library

The Python standard library is a huge collection of ready-made modules that ship with every Python install — no pip required — covering everything from math to file handling to dates.


"Batteries Included"

Python's official philosophy is often summed up as "batteries included" — meaning the moment you install Python, you already have hundreds of useful modules ready to import, without needing pip or an internet connection. This is a huge productivity boost for beginners and professionals alike.

Why This Matters

Instead of writing your own code to generate random numbers, work with dates, or read JSON data, you simply import the relevant module and call well-tested functions that the whole Python community relies on. This saves time and avoids bugs you would otherwise introduce yourself.

A Quick Tour

Below are some of the most commonly used standard library modules you will meet as a beginner, each covered in more depth in their own tutorials.

ModuleUsed For
osInteracting with the operating system: files, folders, paths, environment variables
sysCommand-line arguments, exiting a script, interpreter settings
mathMathematical functions like square root, power, floor, ceiling, constants
randomGenerating random numbers, random choices, shuffling
jsonConverting between Python objects and JSON text for APIs and files
datetimeWorking with dates, times, and time differences
Using several standard library modules together
Python
import os
import random
import datetime

print(os.getcwd())
print(random.randint(1, 6))
print(datetime.date.today())

Standard Library vs Third-Party Packages

Modules like os, sys, math, random, json, and datetime come built in. Libraries such as pandas or requests are third-party — they must be installed with pip first, since they are not part of the standard library.

💡

Before installing a third-party package for a task, check if the standard library already solves it — it usually does, and it needs zero installation.

Each of these modules deserves its own deep dive; the following tutorials in this series walk through os, sys, math, random, json, and datetime individually with plenty of practical examples.

Related Python Topics

Keep learning with these closely related lessons.

Ready to use your Python skills?

Find Python, data science and software internships and fresher jobs across India.

Browse Python Internships