--- id: prtpy version: "0.8.3" license: MIT license_treatment: permissive maintenance: aging --- # prtpy — Number partitioning in Python License: permissive · Maintenance: aging · Downloads: 391.7K/mo ## What it is and what it does prtpy provides a collection of algorithms for partitioning numbers into bins and packing items into fixed-capacity bins. It supports both exact methods (via integer linear programming through the mip library) and approximate greedy algorithms, allowing you to choose between solution quality and computation speed. The package wraps numpy and scipy for numerical operations and can optionally use GUROBI for faster ILP solving. You supply items (with numeric values), a target number of bins or bin capacity, and an optimization objective (e.g., maximize the smallest bin sum, minimize the largest bin sum). The library returns the assignment of items to bins. It's designed for load-balancing, resource allocation, and scheduling problems where you need to distribute work or items fairly or efficiently across a fixed number of containers. Use it for: - Distribute computational tasks across multiple processors to minimize makespan (longest task completion time). - Pack items into shipping containers to minimize the number of containers or maximize container utilization. - Allocate workload across servers to balance CPU or memory usage and avoid overload. - Partition a dataset into balanced subsets for parallel processing or cross-validation in machine learning. - Solve fair division problems where items must be split among parties with minimal imbalance. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Implements multiway number partitioning and bin packing algorithms with support for exact and approximate methods, multiple input formats, and configurable optimization objectives. Yes, if you need a flexible, permissively licensed partitioning or bin-packing solver. The low install friction and zero known vulnerabilities are strengths. However, the aging maintenance status (last release over a year ago, Pre-Alpha classifier) and lack of recent activity suggest treating it as stable but not actively developed—suitable for production use if the algorithm suite meets your needs, but do not expect rapid bug fixes or new features. ## Install pip install prtpy uv add prtpy poetry add prtpy ## Installing prtpy Before you install: Low friction installation with three core runtime dependencies (numpy, scipy, mip). Package is aging—last release was 2024-05-15, over a year ago—but the repository remains active with recent commits and no archived status. License in practice: MIT license permits unrestricted use, modification, and distribution in both open and closed projects with minimal obligations beyond attribution. Quickstart: pip install prtpy import prtpy prtpy.partition(algorithm=prtpy.partitioning.greedy, numbins=2, items=[1,2,3,4,5]) Requires Python 3.8 or later. Optional: GUROBI solver can accelerate ILP-based algorithms via python-mip. Verify before relying: - Whether the package's Pre-Alpha status reflects incomplete feature coverage or simply conservative versioning. - Current performance characteristics and scalability limits for large item sets or bin counts. - Whether the 821 days since last release indicates maintenance abandonment or stable maturity. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 391.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags number partitioning algorithms, bin packing python, multiway partitioning, load balancing optimization, item distribution algorithms, greedy partitioning, bin covering algorithms, optimization, load-balancing, combinatorial-algorithms [View on SkillFed](https://skillfed.io/packages/prtpy) · [View on PyPI](https://pypi.org/project/prtpy/)