{"categories":[{"label":"Scientific/Engineering","url":"https://skillfed.io/packages/category/scientific-engineering/2"},{"label":"Mathematics","url":"https://skillfed.io/packages/category/scientific-engineering-mathematics"}],"enrichment":{"capability":"portion provides data structures and operations for working with intervals\u2014including unions, intersections, complements, and containment tests\u2014with automatic simplification and support for any comparable objects.","skillfed_tags":["interval-arithmetic","range-operations","set-theory"],"use_cases":["Scheduling and time-slot management: represent availability windows and find overlaps or gaps.","Range queries in databases or data structures: efficiently test membership and compute intersections.","Temporal logic and constraint solving: work with time intervals and their logical combinations.","Numerical analysis: represent and manipulate domains, ranges, and solution sets.","Interval mapping: associate data with ranges and query by interval containment."],"what_it_does":"portion is a Python library for creating and manipulating intervals\u2014single ranges or unions of ranges\u2014with automatic simplification and rich set operations. It handles any comparable objects as bounds (numbers, dates, strings) and supports both finite and infinite intervals with open or closed boundaries. The library provides intersection, union, complement, and difference operations, plus tests for emptiness, overlap, and adjacency.\n\nTypical use cases include scheduling systems, range queries, temporal logic, and mathematical interval arithmetic. It includes a dict-like structure to map intervals to data, discrete iteration over interval values, and import/export to strings and Python built-in types. The library is actively maintained, well-tested, and requires only sortedcontainers as a runtime dependency.","worth_installing":"Yes. portion is production-stable (Development Status 5), actively maintained, has no known vulnerabilities, and imposes minimal install friction. The copyleft license (LGPL-3.0-or-later) is a consideration for proprietary use but poses no barrier for open-source projects. Install it if you need interval arithmetic or range operations."},"id":"portion","links":{"html":"https://skillfed.io/packages/portion","md":"https://skillfed.io/packages/portion.md","pypi":"https://pypi.org/project/portion/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-06-14","license_spdx":"LGPL-3.0-or-later","license_treatment":"copyleft","name":"portion","python_support":"supports_current","summary":"Python data structure and operations for intervals"},"popularity":{"monthly_downloads":1697074,"position":3643,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"2.6.2"}
