{"id":13689139,"url":"https://github.com/drvinceknight/Nashpy","last_synced_at":"2025-05-01T23:32:27.308Z","repository":{"id":12860344,"uuid":"72737846","full_name":"drvinceknight/Nashpy","owner":"drvinceknight","description":"A python library for 2 player games.","archived":false,"fork":false,"pushed_at":"2024-03-25T17:44:06.000Z","size":3518,"stargazers_count":333,"open_issues_count":26,"forks_count":71,"subscribers_count":10,"default_branch":"main","last_synced_at":"2024-11-08T04:41:40.080Z","etag":null,"topics":["algorithm","computer-science","equilibria","game","mathematics","nash","python"],"latest_commit_sha":null,"homepage":"http://nashpy.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drvinceknight.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"docs/contributing/discussion/alex/index.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.md","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-03T11:16:26.000Z","updated_at":"2024-10-14T14:38:24.000Z","dependencies_parsed_at":"2024-01-17T06:12:21.150Z","dependency_job_id":"8ef908dd-d51f-4118-8dd3-e41840402091","html_url":"https://github.com/drvinceknight/Nashpy","commit_stats":{"total_commits":277,"total_committers":17,"mean_commits":"16.294117647058822","dds":"0.24187725631768953","last_synced_commit":"0c274a6d0de4139205df722161356d16c4bfa902"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drvinceknight%2FNashpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drvinceknight%2FNashpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drvinceknight%2FNashpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drvinceknight%2FNashpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drvinceknight","download_url":"https://codeload.github.com/drvinceknight/Nashpy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224282135,"owners_count":17285776,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","computer-science","equilibria","game","mathematics","nash","python"],"created_at":"2024-08-02T15:01:35.165Z","updated_at":"2024-11-12T13:30:51.555Z","avatar_url":"https://github.com/drvinceknight.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.596758.svg)](https://doi.org/10.5281/zenodo.596758)\n![](https://github.com/drvinceknight/Nashpy/workflows/CI/badge.svg)\n[![Discord](https://img.shields.io/discord/753185848337367060?label=Discord)](https://discord.gg/wZsv6s8TTB)\n[![Gitter](https://badges.gitter.im/drvinceknight/Nashpy.svg)](https://gitter.im/drvinceknight/Nashpy?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n[![DOI](http://joss.theoj.org/papers/10.21105/joss.00904/status.svg)](https://doi.org/10.21105/joss.00904)\n\n# Nashpy: a python library for 2 player games.\n\nNashpy is:\n\n- An [excellently documented library](https://nashpy.readthedocs.io/en/stable/):\n  - The [Nashpy game theory text book](https://nashpy.readthedocs.io/en/stable/text-book/index.html) aims\n    to be a course text on the background theory.\n  - The [contributor\n    documentation](https://nashpy.readthedocs.io/en/stable/contributing/index.html)\n    aims to be a text on research software development and help **first time** open\n    source software contributions.\n- A [state of the art developed code\n  base](https://nashpy.readthedocs.io/en/stable/contributing/index.html) which\n  aims to use the best of available tools to ensure the code is correct,\n  readable and robust.\n- Feature rich, the following are implemented:\n  - Support enumeration [How to docs 🐍](https://nashpy.readthedocs.io/en/stable/how-to/solve-with-support-enumeration.html) - [Theory docs 📘](https://nashpy.readthedocs.io/en/stable/text-book/support-enumeration.html)\n  - Vertex enumeration [How to docs 🐍](https://nashpy.readthedocs.io/en/stable/how-to/solve-with-vertex-enumeration.html) - [Theory docs 📘](https://nashpy.readthedocs.io/en/stable/text-book/vertex-enumeration.html)\n  - Lemke-Howson algorithm [How to docs 🐍](https://nashpy.readthedocs.io/en/stable/how-to/solve-with-lemke-howson.html) - [Theory docs 📘](https://nashpy.readthedocs.io/en/stable/text-book/lemke-howson.html)\n  - Fictitious play [How to docs 🐍](https://nashpy.readthedocs.io/en/stable/how-to/use-fictitious-play.html) - [Theory docs 📘](https://nashpy.readthedocs.io/en/stable/text-book/fictitious-play.html)\n  - Stochastic fictitious play [How to docs 🐍](https://nashpy.readthedocs.io/en/stable/how-to/use-stochastic-fictitious-play.html) - [Theory docs 📘](https://nashpy.readthedocs.io/en/stable/text-book/stochastic-fictitious-play.html)\n  - Replicator dynamics [How to docs 🐍](https://nashpy.readthedocs.io/en/stable/how-to/use-replicator-dynamics.html) - [Theory docs 📘](https://nashpy.readthedocs.io/en/stable/text-book/replicator-dynamics.html)\n  - Replicator-mutation dynamics [How to docs 🐍](https://nashpy.readthedocs.io/en/stable/how-to/use-replicator-dynamics-with-mutation.html) - [Theory docs 📘](https://nashpy.readthedocs.io/en/stable/text-book/replicator-dynamics.html#the-replicator-mutation-dynamics-equation)\n  - Asymmetric replicator dynamics [How to docs 🐍](https://nashpy.readthedocs.io/en/stable/how-to/use-asymmetric-replicator-dynamics.html) - [Theory docs 📘](https://nashpy.readthedocs.io/en/stable/text-book/asymmetric-replicator-dynamics.html)\n  - Moran processes [How to docs 🐍](https://nashpy.readthedocs.io/en/stable/how-to/use-moran-processes.html)\n  - Generate games from repeated games [How to docs 🐍](https://nashpy.readthedocs.io/en/stable/how-to/obtain-a-repeated-game.html) - [Theory docs 📘](https://nashpy.readthedocs.io/en/stable/text-book/repeated-games.html)\n  - Moran processes on interaction graphs [How to docs 🐍](https://nashpy.readthedocs.io/en/stable/how-to/use-moran-process-on-interaction-graph.html)\n  - Moran processes on replication graphs [How to docs 🐍](https://nashpy.readthedocs.io/en/stable/how-to/use-moran-process-on-replication-graph.html)\n\n## Documentation\n\nFull documentation is available here: http://nashpy.readthedocs.io/\n\n## Installation\n\n```bash\n$ python -m pip install nashpy\n```\n\nTo install Nashpy on Fedora, use:\n\n```sh\n$ dnf install python3-nashpy\n```\n\n## Usage\n\n\u003c!--alex ignore bi--\u003e\n\nCreate bi matrix games by passing two 2 dimensional arrays/lists:\n\n```python\n\u003e\u003e\u003e import nashpy as nash\n\u003e\u003e\u003e A = [[1, 2], [3, 0]]\n\u003e\u003e\u003e B = [[0, 2], [3, 1]]\n\u003e\u003e\u003e game = nash.Game(A, B)\n\u003e\u003e\u003e for eq in game.support_enumeration():\n...     print(eq)\n(array([1., 0.]), array([0., 1.]))\n(array([0., 1.]), array([1., 0.]))\n(array([0.5, 0.5]), array([0.5, 0.5]))\n\u003e\u003e\u003e game[[0, 1], [1, 0]]\narray([3, 3])\n\n```\n\n## Other game theoretic software\n\n- [Gambit](http://www.gambit-project.org/) is a library with a python api and\n  support for more algorithms and more than 2 player games.\n- [Game theory explorer](http://gte.csc.liv.ac.uk/index/) a web interface to\n  gambit useful for teaching.\n- [Axelrod](http://axelrod.readthedocs.io/en/stable/) a research library aimed\n  at the study of the Iterated Prisoners dilemma\n\n## Development\n\nClone the repository and create a virtual environment:\n\n```bash\n$ git clone https://github.com/drvinceknight/nashpy.git\n$ cd nashpy\n$ python -m venv env\n\n```\n\nActivate the virtual environment and install [`tox`](https://tox.readthedocs.io/en/latest/):\n\n```bash\n$ source env/bin/activate\n$ python -m pip install tox\n\n```\n\nMake modifications.\n\nTo run the tests:\n\n```bash\n$ python -m tox\n\n```\n\nTo build the documentation. First install the software which also installs the\ndocumentation build requirements.\n\n```bash\n$ python -m pip install flit\n$ python -m flit install --symlink\n```\n\nThen:\n\n```bash\n$ cd docs\n$ make html\n```\n\nFull contribution documentation is available at\nhttps://nashpy.readthedocs.io/en/latest/contributing/index.html\n\nPull requests are welcome.\n\n## Code of conduct\n\nIn the interest of fostering an open and welcoming environment, all\ncontributors, maintainers and users are expected to abide by the Python code of\nconduct: https://www.python.org/psf/codeofconduct/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrvinceknight%2FNashpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrvinceknight%2FNashpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrvinceknight%2FNashpy/lists"}