--- id: permutation version: "0.5.0" license: MIT license_treatment: permissive maintenance: active --- # permutation — Permutations of finitely many positive integers License: permissive · Maintenance: active · Downloads: 142.9K/mo ## What it is and what it does permutation is a pure-Python library for working with permutations of finitely many positive integers. It provides a Permutation class that lets you construct, compose, and analyze permutations using standard group-theoretic operations. You can represent permutations in cycle notation, compute their inverses and order, check parity, convert to and from Lehmer codes, and use them as callables to map integers. The package is designed for developers and mathematicians who need to work with permutation groups, symmetric groups, or permutation-based algorithms. It has no external runtime dependencies, making it lightweight to install, and is fully typed. The library supports both CPython and PyPy across modern Python versions. Use it for: - Implementing group-theoretic algorithms that require permutation composition and cycle analysis. - Computing properties of permutations such as order, parity, and cycle structure for mathematical research. - Building combinatorial or cryptographic tools that manipulate permutations as callable objects. - Converting between permutation representations (cycle notation, word form, Lehmer codes) for educational or algorithmic purposes. - Generating and iterating over symmetric groups for exhaustive search or enumeration tasks. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a Permutation class for representing and manipulating permutations of positive integers, supporting operations like composition, cycle decomposition, inverses, order, parity, and Lehmer codes. Yes. The package is actively maintained, has zero known vulnerabilities, installs with no friction, and carries a permissive MIT license. It fills a clear niche for group-theoretic permutation work in Python with a well-documented, typed API. Install it if you need to work with permutations; skip it if your use case doesn't involve permutation algebra. ## Install pip install permutation uv add permutation poetry add permutation ## Installing permutation Before you install: Low friction installation with no runtime dependencies. Actively maintained as of 2026-07-20 with support across Python 3.8 through 3.13 and PyPy. License in practice: MIT license (permissive) — you can use, modify, and distribute this package with minimal restrictions, including in proprietary software. Quickstart: pip install permutation from permutation import Permutation p = Permutation(2, 1, 4, 5, 3) print(p.to_cycles()) # [(1, 2), (3, 4, 5)] print(p.order) # 6 Requires Python 3.8 or higher. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 142.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags permutation group theory, cycle notation permutations, symmetric group operations, permutation composition, cycle decomposition, permutation inverse order parity, lehmer code permutation, group-theory, combinatorics, typed [View on SkillFed](https://skillfed.io/packages/permutation) · [View on PyPI](https://pypi.org/project/permutation/)