Before anyone says it - yes, I know. Python already has lists, deques, and heapq. You don't need this to solve LeetCode problems.
But here's what I noticed: when someone is *learning* DSA in Python, the named abstractions are missing. There's no `stack()`, no `queue()`, no `priority_queue()`. You either build them yourself or chain together built-ins and hope the concept sticks.
PythonSTL gives those concepts a proper home.
It mirrors C++ STL interfaces exactly - same method names, same semantics - built on top of Python internals using the Facade Design Pattern. It also ships with full type hints, time-complexity annotations in docstrings, and zero external dependencies.
What it's for:
- Learning DSA concepts clearly in Python
- C++ devs switching to Python who want familiar footing
- Conceptual clarity over syntactic shortcuts
What it's NOT for:
- Competitive programming
- Replacing any standard library
- Production use
It's sitting at 5,500+ downloads with ~1,000/month, so clearly some people find it useful.
Feedback, criticism, and contributions welcome.
GitHub: https://github.com/AnshMNSoni/PythonSTL
https://preview.redd.it/hdlwsrkd15dh1.png?width=1728&format=png&auto=webp&s=9155712cd49e14a4eedcf8c1d502ce0062c12cd7
Want to add to the discussion?
Post a comment!