My problem: “*There is an arbitrary amount of arbitrary sized rectangles. How to put them in a smallest possible rectangle?”*

This is the so called **2D Binary Packing** problem, or **Rectangle Packing** problem, but til now I have found only this program in picture (LinPacker), but the algorithms there are not available to implement in Python. Can anyone help me? This is needed for a city planning project, the rectangles represent existing quarters.