--- id: nashpy version: "0.0.43" license: unclear license_treatment: permissive maintenance: aging --- # nashpy — A library with algorithms on 2 player games. License: permissive · Maintenance: aging · Downloads: 3.6M/mo ## What it is and what it does Nashpy is a Python library for analyzing two-player strategic games. It implements a range of algorithms to find Nash equilibria—the stable strategy profiles where neither player can improve by unilaterally changing their strategy—and to simulate evolutionary dynamics like fictitious play and replicator dynamics. The library is built on numpy, scipy, and networkx, making it suitable for both teaching game theory and conducting research. You define a game by providing two payoff matrices (one for each player), then call methods to compute equilibria or run simulations. The library includes support enumeration, vertex enumeration, the Lemke-Howson algorithm, fictitious play variants, replicator dynamics with and without mutation, Moran processes on interaction and replication graphs, and introspection dynamics. It is well-documented with both theory and how-to guides. Use it for: - Teaching game theory: use the documented algorithms and examples to illustrate Nash equilibria and strategic reasoning. - Computing equilibria in two-player games: solve for mixed and pure strategy equilibria in bimatrix games. - Simulating evolutionary game dynamics: model population-level strategy evolution using replicator dynamics or Moran processes. - Analyzing repeated games: generate and analyze games derived from repeated interactions. - Research in game-theoretic modeling: implement custom game-theoretic analyses with built-in algorithm support. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Nashpy computes Nash equilibria and simulates strategic interactions in two-player games using algorithms like support enumeration, vertex enumeration, Lemke-Howson, fictitious play, and replicator dynamics. Yes, if you work with two-player game theory. Nashpy has low install friction, permissive licensing, no known vulnerabilities, and comprehensive algorithm coverage with good documentation. The aging maintenance status (281 days since last release) is a minor concern for a stable library but worth monitoring if you need active development or bug fixes. ## Install pip install nashpy uv add nashpy poetry add nashpy ## Installing nashpy Before you install: Low install friction with a pure-Python wheel and four standard scientific dependencies (numpy, scipy, networkx, deprecated). Last release was 281 days ago; the repository is active but aging. License in practice: MIT license (permissive) means you can use, modify, and distribute Nashpy freely in commercial and private projects with minimal restrictions. Quickstart: import nashpy as nash A = [[1, 2], [3, 0]] B = [[0, 2], [3, 1]] game = nash.Game(A, B) for eq in game.support_enumeration(): print(eq) Requires Python 3.10 or later. Verify before relying: - Whether the library scales efficiently to larger game matrices or more complex strategy spaces. - Performance characteristics of different equilibrium-finding algorithms on realistic game sizes. - Whether Moran process and replicator dynamics implementations are suitable for research-grade analysis. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 3.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags nash equilibrium solver, two player game theory, game theory algorithms, strategic interaction simulation, bimatrix game solver, equilibrium computation, game theoretic analysis, game-theory, equilibrium-computation, educational [View on SkillFed](https://skillfed.io/packages/nashpy) · [View on PyPI](https://pypi.org/project/nashpy/)