{"library":"rectpack","title":"rectpack - 2D Rectangle Packing","description":"A Python library for packing 2D rectangles into a bin using various algorithms (MaxRects, Guillotine, etc.). Supports rotation, sorting, and multiple packing modes. Current version 0.2.2, maintained infrequently.","language":"python","status":"active","last_verified":"Sat May 09","install":{"commands":["pip install rectpack"],"cli":null},"imports":["from rectpack import Packer","from rectpack import MaxRectsBssf","from rectpack import GuillotineBssfSas"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from rectpack import Packer, MaxRectsBssf\nfrom rectpack import SORT_AREA\n\npacker = Packer()\n# Use a packing algorithm\npacker.add_bin(100, 100)\npacker.add_rect(50, 30, rid='rect1')\npacker.add_rect(20, 40, rid='rect2')\npacker.pack_algo = MaxRectsBssf()\npacker.sort_algo = SORT_AREA\npacker.pack()\nfor rect in packer.rect_list():\n    print('Rectangle:', rect)\n# Alternatively, get a summary\nprint('Bins:', packer.bins)  # list of Bin objects\nprint('Unpacked:', packer.unused_areas())","lang":"python","description":"Basic packing of two rectangles into a 100x100 bin using MaxRects BSSF algorithm.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}