rbush
High-performance 2D spatial index for rectangles (based on R*-tree with bulk loading and bulk insertion algorithms)
flatbush
Fast static spatial index for rectangles
bin-pack
A packing algorithm for 2D bin packing. Largely based on code and a blog post by Jake Gordon.