Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 5 DOI reference(s) in README
  • Academic publication links
    Links to: joss.theoj.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.8%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

Basic Info
  • Host: GitHub
  • Owner: brainpaingames
  • License: apache-2.0
  • Language: Python
  • Default Branch: main
  • Size: 14.4 MB
Statistics
  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created 12 months ago · Last pushed 11 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct Citation

README.md

Mesa: Agent-based modeling in Python

| | | |---------| --- | | CI/CD | GitHub Actions build status Coverage status | | Package | PyPI - Version PyPI - Downloads PyPI - Python Version | | Meta | linting - Ruff code style: black Hatch project SPEC 0 — Minimum Supported Dependencies | | Chat | chat | | Cite | DOI |

Mesa allows users to quickly create agent-based models using built-in core components (such as spatial grids and agent schedulers) or customized implementations; visualize them using a browser-based interface; and analyze their results using Python's data analysis tools. Its goal is to be the Python-based alternative to NetLogo, Repast, or MASON.

A screenshot of the WolfSheep Model in Mesa

Above: A Mesa implementation of the WolfSheep model, this can be displayed in browser windows or Jupyter.

Features

  • Modular components
  • Browser-based visualization
  • Built-in tools for analysis
  • Example model library

Using Mesa

To install our latest stable release, run:

bash pip install -U mesa

Starting with Mesa 3.0, we don't install all our dependencies anymore by default. ```bash

You can customize the additional dependencies you need, if you want. Available are:

pip install -U "mesa[network,viz]"

This is equivalent to our recommended dependencies:

pip install -U "mesa[rec]"

To install all, including developer, dependencies:

pip install -U "mesa[all]" ```

You can also use pip to install the latest GitHub version:

bash pip install -U -e git+https://github.com/projectmesa/mesa@main#egg=mesa

Or any other (development) branch on this repo or your own fork:

bash pip install -U -e git+https://github.com/YOUR_FORK/mesa@YOUR_BRANCH#egg=mesa

Resources

For resources or help on using Mesa, check out the following:

Running Mesa in Docker

You can run Mesa in a Docker container in a few ways.

If you are a Mesa developer, first install Docker Compose and then, in the folder containing the Mesa Git repository, you run:

``` bash $ docker compose up

If you want to make it run in the background, you instead run

$ docker compose up -d ```

This runs the Schelling model, as an example.

With the docker-compose.yml file in this Git repository, the docker compose up command does two important things:

  • It mounts the mesa root directory (relative to the docker-compose.yml file) into /opt/mesa and runs pip install -e on that directory so your changes to mesa should be reflected in the running container.
  • It binds the docker container's port 8765 to your host system's port 8765 so you can interact with the running model as usual by visiting localhost:8765 on your browser

If you are a model developer that wants to run Mesa on a model, you need to:

  • make sure that your model folder is inside the folder containing the docker-compose.yml file
  • change the MODEL_DIR variable in docker-compose.yml to point to the path of your model
  • make sure that the model folder contains an app.py file

Then, you just need to run docker compose up -d to have it accessible from localhost:8765.

Contributing to Mesa

Want to join the Mesa team or just curious about what is happening with Mesa? You can...

  • Join our Matrix chat room in which questions, issues, and ideas can be (informally) discussed.
  • Come to a monthly dev session (you can find dev session times, agendas and notes on Mesa discussions).
  • Just check out the code on GitHub.

If you run into an issue, please file a ticket for us to discuss. If possible, follow up with a pull request.

If you would like to add a feature, please reach out via ticket or join a dev session (see Mesa discussions). A feature is most likely to be added if you build it!

Don't forget to checkout the Contributors guide.

Citing Mesa

To cite Mesa in your publication, you can refer to our peer-reviewed article in the Journal of Open Source Software (JOSS): - ter Hoeven, E., Kwakkel, J., Hess, V., Pike, T., Wang, B., rht, & Kazil, J. (2025). Mesa 3: Agent-based modeling with Python in 2025. Journal of Open Source Software, 10(107), 7668. https://doi.org/10.21105/joss.07668

Our CITATION.cff can be used to generate APA, BibTeX and other citation formats.

Owner

  • Name: Brainpaingames
  • Login: brainpaingames
  • Kind: user

Citation (CITATION.cff)

cff-version: "1.2.0"
authors:
- family-names: Hoeven
  given-names: Ewout
  name-particle: ter
  orcid: "https://orcid.org/0009-0002-0805-3425"
- family-names: Kwakkel
  given-names: Jan
  orcid: "https://orcid.org/0000-0001-9447-2954"
- family-names: Hess
  given-names: Vincent
  orcid: "https://orcid.org/0000-0002-9242-8500"
- family-names: Pike
  given-names: Thomas
  orcid: "https://orcid.org/0000-0003-1576-0283"
- family-names: Wang
  given-names: Boyu
  orcid: "https://orcid.org/0000-0001-9879-2138"
- family-names: rht
  orcid: "https://orcid.org/0009-0002-6902-111X"
- family-names: Kazil
  given-names: Jackie
  orcid: "https://orcid.org/0000-0002-8300-7384"
doi: 10.5281/zenodo.15090710
message: If you use this software, please cite our article in the
  Journal of Open Source Software.
preferred-citation:
  authors:
  - family-names: Hoeven
    given-names: Ewout
    name-particle: ter
    orcid: "https://orcid.org/0009-0002-0805-3425"
  - family-names: Kwakkel
    given-names: Jan
    orcid: "https://orcid.org/0000-0001-9447-2954"
  - family-names: Hess
    given-names: Vincent
    orcid: "https://orcid.org/0000-0002-9242-8500"
  - family-names: Pike
    given-names: Thomas
    orcid: "https://orcid.org/0000-0003-1576-0283"
  - family-names: Wang
    given-names: Boyu
    orcid: "https://orcid.org/0000-0001-9879-2138"
  - family-names: rht
    orcid: "https://orcid.org/0009-0002-6902-111X"
  - family-names: Kazil
    given-names: Jackie
    orcid: "https://orcid.org/0000-0002-8300-7384"
  date-published: 2025-03-28
  doi: 10.21105/joss.07668
  issn: 2475-9066
  issue: 107
  journal: Journal of Open Source Software
  publisher:
    name: Open Journals
  start: 7668
  title: "Mesa 3: Agent-based modeling with Python in 2025"
  type: article
  url: "https://joss.theoj.org/papers/10.21105/joss.07668"
  volume: 10
title: "Mesa 3: Agent-based modeling with Python in 2025"

GitHub Events

Total
  • Issue comment event: 2
  • Push event: 8
  • Pull request event: 1
  • Create event: 3
Last Year
  • Issue comment event: 2
  • Push event: 8
  • Pull request event: 1
  • Create event: 3

Dependencies

.github/workflows/benchmarks.yml actions
  • actions/checkout v4 composite
  • actions/download-artifact v4 composite
  • actions/github-script v7 composite
  • actions/setup-python v5 composite
  • actions/upload-artifact v4 composite
.github/workflows/build_lint.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
  • codecov/codecov-action v5 composite
.github/workflows/release.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
  • actions/upload-artifact v4 composite
  • pypa/gh-action-pypi-publish release/v1 composite
Dockerfile docker
  • python bookworm build
docker-compose.yml docker
  • mesa dev
Pipfile pypi
  • mesa *
Pipfile.lock pypi
  • altair ==5.5.0
  • anyio ==4.9.0
  • asttokens ==3.0.0
  • attrs ==25.3.0
  • cachetools ==6.1.0
  • certifi ==2025.6.15
  • charset-normalizer ==3.4.2
  • click ==8.2.1
  • colorama ==0.4.6
  • comm ==0.2.2
  • contourpy ==1.3.2
  • cycler ==0.12.1
  • debugpy ==1.8.14
  • decorator ==5.2.1
  • executing ==2.2.0
  • fastjsonschema ==2.21.1
  • filelock ==3.18.0
  • fonttools ==4.58.4
  • h11 ==0.16.0
  • humanize ==4.12.3
  • idna ==3.10
  • ipykernel ==6.29.5
  • ipython ==9.3.0
  • ipython-pygments-lexers ==1.1.1
  • ipyvue ==1.11.2
  • ipyvuetify ==1.11.2
  • ipywidgets ==8.1.7
  • jedi ==0.19.2
  • jinja2 ==3.1.6
  • jsonschema ==4.24.0
  • jsonschema-specifications ==2025.4.1
  • jupyter-client ==8.6.3
  • jupyter-core ==5.8.1
  • jupyterlab-widgets ==3.0.15
  • kiwisolver ==1.4.8
  • markdown ==3.8.2
  • markdown-it-py ==3.0.0
  • markupsafe ==3.0.2
  • matplotlib ==3.10.3
  • matplotlib-inline ==0.1.7
  • mdurl ==0.1.2
  • mesa *
  • narwhals ==1.44.0
  • nbformat ==5.10.4
  • nest-asyncio ==1.6.0
  • networkx ==3.5
  • numpy ==2.3.1
  • packaging ==25.0
  • pandas ==2.3.0
  • parso ==0.8.4
  • pillow ==11.2.1
  • platformdirs ==4.3.8
  • prompt-toolkit ==3.0.51
  • psutil ==7.0.0
  • pure-eval ==0.2.3
  • pygments ==2.19.2
  • pymdown-extensions ==10.16
  • pyparsing ==3.2.3
  • python-dateutil ==2.9.0.post0
  • pytz ==2025.2
  • pywin32 ==310
  • pyyaml ==6.0.2
  • pyzmq ==27.0.0
  • reacton ==1.9.1
  • referencing ==0.36.2
  • requests ==2.32.4
  • rich ==14.0.0
  • rich-click ==1.8.9
  • rpds-py ==0.25.1
  • scipy ==1.16.0
  • six ==1.17.0
  • sniffio ==1.3.1
  • solara ==1.49.0
  • solara-server ==1.49.0
  • solara-ui ==1.49.0
  • stack-data ==0.6.3
  • starlette ==0.47.1
  • tornado ==6.5.1
  • tqdm ==4.67.1
  • traitlets ==5.14.3
  • typing-extensions ==4.14.0
  • tzdata ==2025.2
  • urllib3 ==2.5.0
  • uvicorn ==0.34.3
  • watchdog ==6.0.0
  • watchfiles ==1.1.0
  • wcwidth ==0.2.13
  • websockets ==15.0.1
  • widgetsnbextension ==4.0.14
binder/environment.yml pypi
  • matplotlib *
  • mesa *
  • nbgitpuller *
  • pandas *
  • seaborn *
  • solara *
pyproject.toml pypi
  • numpy *
  • pandas *
  • pythran >=0.17.0 ; sys_platform == 'darwin'
  • scipy *
  • tqdm *
uv.lock pypi
  • 136 dependencies