
How I Discovered the Hidden Cost of "Lightweight" Python Packages
The "It's Just a Small Library" Trap We've all been there. You find a Python package that promises to solve your problem with minimal overhead. The README says "lightweight," the GitHub stars look good, and the developer swears it's "just a few kilobytes." So you install it, run your project, and wonder why your Docker image grew by 200MB. What happened? The package is small. But its dependencies aren't. And those dependencies have dependencies. And those... you get the idea. The Moment I Realized Something Was Missing I was comparing HTTP libraries for a new project. requests is popular, but everyone says it's "heavy." Then I found a library that claimed to be a "lightweight alternative." But something in my gut said "let me check." So I built pip-size ā a tool that calculates the real download size of PyPI packages and their dependencies, using only the PyPI JSON API. No downloads. No pip subprocess. Just data. Install it: pip install pip-size Compare HTTP libraries fairly: pip-size
Continue reading on Dev.to
Opens in a new tab



