DEV Community

Sameer Qaiser
Sameer Qaiser

Posted on

Top 5 Python Libraries Every Beginner Should Know

📌 Quick Info

  • Topic: The five Python libraries that actually matter for beginners
  • Target Audience: Beginners who know the basics and want to build real things
  • Goal: Cut through the noise — not list every library in existence

1. Introduction

"There are over 400,000 packages on PyPI. That number is useless to a beginner. Here are the five that actually changed what I could build."


2. How I Chose These Five

I didn't pick the "most popular" libraries. I picked the ones that:

  1. Solve a problem you'll actually run into
  2. Are beginner-friendly (no steep learning curve)
  3. Are used in real projects, not just tutorials
  4. Open doors to more advanced work once you know them

There are thousands of Python libraries. These are the five I'd start with.


3. #1 — requests (Talking to the Internet)

What it does: Makes HTTP requests simple.

Why it matters: Almost every modern app talks to the internet. Fetching data from an API, downloading a file, posting to a service — requests is how Python does it.

Example:

import requests

response = requests.get("<https://api.github.com/users/torvalds>")
data = response.json()
print(data["name"])
Enter fullscreen mode Exit fullscreen mode

When to learn it: As soon as you understand functions and JSON.


4. #2-Json (Built in, But essential)

What it does: Reads and writes JSON -the standard format for data on the web.

Why it matters: APIs return JSN. Config Files are JSON. Every modern data pipeline uses JSON somewhere.

Example:

import json

user = {"name": "Ali", "age": 25}

with open("user.json", "w") as f:
    json.dump(user, f, indent=2)
Enter fullscreen mode Exit fullscreen mode

When to learn it: Right after you learn file handling.


5. #3-csv (Built-in, But Ignored)

What it does: Reads and writes CSV files- the format of every spreadsheet and database export.

Why it matters: Real Data lives in CSVs. If you can’t read and write them, you can’t work with real-world data.

Example:

import csv

with open("users.csv", "r") as f:
    reader = csv.DictReader(f)
    for row in reader:
        print(row["name"])
Enter fullscreen mode Exit fullscreen mode

When to learn it: As soon as you start working with data.


6. #4-pandas (Data Manipulation)

What it does: Works with tabular data- think “Excel inside Python.”

Why it matters: If you ever need to filter, group, join, or analyze data, pandas is the tool. It’s the backbone of data science and analysis in python.

Example:

import pandas as pd

df = pd.read_csv("sales.csv")
print(df.groupby("region")["revenue"].sum())
Enter fullscreen mode Exit fullscreen mode

When to learn it: After you’re comfortable with lists, dictionaries, and CSVs.

Warning: Pandas is powerful but has a learning curve. Don’t jump in on day one.


7. #5-pytest (Testing)

What it does: Lets you write tests for your code.

Why it matters: Most Beginners never write tests. That’s why their projects break the moment thet change something. pytest teaches you to write code you can trust.

Example:

def add(a, b):
    return a + b

def test_add():
    assert add(2, 3) == 5
    assert add(-1, 1) == 0
Enter fullscreen mode Exit fullscreen mode

When to learn it: As soon as your scripts get longer than 50 lines.


8. Quick Comparison

Library Type Learn When Why
requests external After Functions + JSON Talk to APIs
json Built-in After File Handling Work with data
csv Built-in After File Handling Real-world data
pandas External After lists + dicts Analyze Data
pytest External After scripts get bigger Write reliable code

9. What I’d Skip (For Now)

These Libraries are popular but not useful for beginners yet:

Library Why Skip It
Django Full web framework- way too much at once.
Flask Better after you understand functions well.
NumPy Learn it after pandas
TensorFlow/ PyTorch AI/ML- learn after you have foundations.
scikit-learn Same-later
beautifulsoup Learn after requests
selenium Learn after requests

There’s no rush. Learn the fundamentals first.


10. How to learn these (In Order)

Here’s the path I’d take:

  1. json- one afternoon
  2. csv- one afternoon
  3. requests- a few days of practice
  4. pandas- a few weeks to get comfortable
  5. pytest- a week to build the habit

That’s it. Five libraries. Each one compounds on the last.


11. Conclusion

"You don't need 400,000 libraries. You need five. Learn them deeply, not shallowly. Build something small with each one. By the time you're done, you'll have the foundation for almost anything Python can do.”

Top comments (0)