Skip to content

Checking your reading list…

Retry verification

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

Top 10 Essential Python Packages Every Developer Should Know
Fundamentals 11 min read

Top 10 Essential Python Packages Every Developer Should Know

This article presents a curated list of the ten most essential and widely used Python packages—including NumPy, Pendulum, Pillow, MoviePy, Requests, Tkinter, PyQt, Pandas, Pywin32, and Pytest—explaining their core functionalities, typical use cases, and providing practical code examples to help developers quickly adopt them in various projects.

1. NumPy

NumPy makes complex mathematical operations easy by providing multi‑dimensional arrays and a suite of numerical functions. It is fundamental for scientific computing and also underpins machine‑learning libraries such as TensorFlow.

import numpy as np

a = np.arange(15).reshape(3, 5)
print(a)
print(a.shape)
print(a.ndim)
print(a.dtype.name)
print(a.itemsize)
print(a.size)
print(type(a))

b = np.array([6, 7, 8])
print(b)
print(type(b))

2. Pendulum

Pendulum is a drop‑in replacement for the built‑in datetime module, offering a more intuitive API and automatic timezone handling.

import pendulum

now = pendulum.now("Europe/Paris")
now = now.in_timezone("America/Toronto")
print(now.to_iso8601_string())
now = now.add(days=2)
print(now)

3. Pillow (Python Imaging Library)

Pillow enables opening, manipulating, and saving images in many formats, making it the go‑to library for basic image processing tasks.

from PIL import Image

im = Image.open("images/cuba.jpg")
im.show()
im = im.rotate(45)
im.show()

4. MoviePy

MoviePy provides high‑level functions for importing, editing, and exporting video files, such as adding titles or rotating clips.

from skimage.filters import gaussian_filter
from moviepy.editor import VideoFileClip

def blur(image):
    """Return a blurred (radius=2 pixels) version of the image"""
    return gaussian_filter(image.astype(float), sigma=2)

clip = VideoFileClip("my_video.mp4")
clip_blurred = clip.fl_image(blur)
clip_blurred.write_videofile("blurred_video.mp4")

5. requests

The requests library simplifies HTTP communication with a clean, human‑readable API, handling query strings, POST data, and connection persistence automatically.

import requests
from requests.exceptions import HTTPError

for url in ["https://api.github.com", "https://api.github.com/invalid"]:
    try:
        response = requests.get(url)
        response.raise_for_status()
    except HTTPError as http_err:
        print(f"HTTP error occurred: {http_err}")
    except Exception as err:
        print(f"Other error occurred: {err}")
    else:
        print("Success!")

6. Tkinter

Tkinter is the standard Python interface to the Tk GUI toolkit and is ideal for creating simple cross‑platform graphical applications.

from tkinter import *

window = Tk()
window.title("Welcome to LikeGeeks app")
window.mainloop()

7. PyQt

PyQt provides bindings to the Qt framework, offering a richer set of widgets for building more complex, native‑looking desktop applications.

(Code example omitted for brevity.)

8. Pandas

Pandas is the premier library for data manipulation and analysis in Python, allowing easy handling of time‑series data, statistical operations, and CSV/Excel I/O.

import pandas as pd
import numpy as np

dates = pd.date_range("20130101", periods=6)
df = pd.DataFrame(np.random.randn(6, 4), index=dates, columns=list("ABCD"))
print(df)

9. Pywin32

Pywin32 gives Python access to many Windows APIs, enabling tasks such as registry manipulation, COM automation, and controlling Office applications.

import win32com.client as win32
excel = win32.gencache.EnsureDispatch('Excel.Application')
excel.Visible = True
input("Press ENTER to quit:")
excel.Application.Quit()

10. Pytest

Pytest is a powerful testing framework that supports simple unit tests as well as complex functional testing, making it essential for maintaining code quality in larger projects.

# test_capitalize.py
import pytest

def test_capital_case():
    assert capital_case('semaphore') == 'Semaphore'

def test_raises_exception_on_non_string_arguments():
    with pytest.raises(TypeError):
        capital_case(9)

These ten packages form a solid foundation for general‑purpose Python development, covering numerical computing, date‑time handling, image/video processing, HTTP requests, GUI creation, Windows automation, data analysis, and testing.

About this article

For questions about attribution, corrections or content rights, please contactadmin@besthub.devand we will review it promptly.

Report an issue with this article
testingNumPyEssential Packages

Reader feedback

Was this useful?

Useful0

Discussion 0

Questions, practical examples and thoughtful responses.

Open full discussion