Computer Software

Python Modules & Their Uses

The list of Python Modules and their uses are:

Built-in (Standard Library) Modules

(these come pre-installed with Python)

  • os → Interact with operating system (files, paths, environment).
  • sys → System-specific functions (command-line arguments, interpreter info).
  • math → Mathematical functions (sqrt, factorial, trigonometry).
  • random → Generate random numbers, shuffle, choices.
  • datetime → Work with dates and times.
  • time → Time-related functions (sleep, timestamps).
  • json → Parse & write JSON data.
  • re → Regular expressions (pattern matching).
  • collections → Specialized data structures (Counter, defaultdict, deque).
  • itertools → Tools for iterators (permutations, combinations, infinite loops).
  • functools → Higher-order functions (reduce, lru_cache, partial).
  • statistics → Basic statistics (mean, median, stdev).
  • subprocess → Run external programs/commands.
  • http.client / urllib → Work with HTTP requests.
  • argparse → Build command-line interfaces.
  • shutil → File operations (copy, move, delete).
  • pickle → Serialize and deserialize Python objects.

Data Science & ML Modules

(need to be installed separately with pip)

  • numpy → Numerical computing, arrays, linear algebra.
  • pandas → Data manipulation & analysis (DataFrames).
  • matplotlib → Data visualization (charts, plots).
  • seaborn → Advanced statistical visualization.
  • scipy → Scientific computing, advanced math & stats.
  • scikit-learn → Machine learning (classification, regression, clustering).
  • tensorflow / pytorch → Deep learning frameworks.
  • statsmodels → Statistical models & hypothesis testing.

Web Development Modules

  • flask → Lightweight web framework.
  • django → Full-featured web framework.
  • fastapi → Modern API development.
  • requests → HTTP requests (GET, POST).
  • beautifulsoup4 (bs4) → Web scraping.
  • selenium → Browser automation.

Automation & Scripting Modules

  • pyautogui → Automate keyboard & mouse actions.
  • schedule → Task scheduling.
  • logging → Logging and debugging.
  • configparser → Handle configuration files.

Data Storage & Database Modules

  • sqlite3 → Lightweight database.
  • sqlalchemy → Database ORM (Object Relational Mapper).
  • pymongo → Work with MongoDB.
  • mysql-connector-python → MySQL connector.

Cybersecurity & Networking Modules

  • hashlib → Hashing (MD5, SHA).
  • socket → Network programming (TCP/UDP).
  • cryptography → Encryption & security.
  • paramiko → SSH automation.

Other Useful Modules

  • tkinter → GUI applications.
  • pygame → Game development.
  • openpyxl → Excel file reading/writing.
  • reportlab → PDF generation.
  • PIL / pillow → Image processing.

Click here for PDF cheat sheet of Python modules & uses (like a quick reference guide you can print).

Show More

Related Articles

Back to top button
History Of 1st July Get ready for the ICC Men’s Cricket World Cup 2023! Yoga according to the Bhagavad Gita