Skip to main content

Reproduce the Axelrod iterated prisoners dilemma tournament

Project description

Join the chat at



A Python library with the following principles and goals:

  1. Enabling the reproduction of previous Iterated Prisoner’s Dilemma research as easily as possible.
  2. Creating the de-facto tool for future Iterated Prisoner’s Dilemma research.
  3. Providing as simple a means as possible for anyone to define and contribute new and original Iterated Prisoner’s Dilemma strategies.
  4. Emphasizing readability along with an open and welcoming community that is accommodating for developers and researchers of a variety of skill levels.


With Axelrod you:

The library has 100% test coverage and is extensively documented. See the documentation for details and examples of all the features:

An open reproducible framework for the study of the iterated prisoner’s dilemma: a peer reviewed paper introducing the library (22 authors).


The library requires Python 3.6 or greater.

The simplest way to install is:

$ pip install axelrod

To install from source:

$ git clone
$ cd Axelrod
$ python install

Quick Start

The following runs a basic tournament:

>>> import axelrod as axl
>>> players = [s() for s in axl.demo_strategies]  # Create players
>>> tournament = axl.Tournament(players, seed=1)  # Create a tournament
>>> results =  # Play the tournament
>>> results.ranked_names
['Defector', 'Grudger', 'Tit For Tat', 'Cooperator', 'Random: 0.5']



All contributions are welcome!

You can find helpful instructions about contributing in the documentation:


You can find a list of publications that make use of or cite the library on the citations page.


The library has had many awesome contributions from many great contributors. The Core developers of the project are:

Project details

Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Axelrod-4.12.0.tar.gz (207.7 kB view hashes)

Uploaded source

Built Distribution

Axelrod-4.12.0-py2.py3-none-any.whl (192.0 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page