Skip to main content

A framework for creating bio-inspired computational intelligence algorithms in Python

Project description

inspyred is a free, open source framework for creating biologically-inspired computational intelligence algorithms in Python, including evolutionary computation, swarm intelligence, and immunocomputing. Additionally, inspyred provides easy-to-use canonical versions of many bio-inspired algorithms for users who do not need much customization.


The following example illustrates the basics of the inspyred package. In this example, candidate solutions are 10-bit binary strings whose decimal values should be maximized:

import random
import time
import inspyred

def generate_binary(random, args):
    bits = args.get('num_bits', 8)
    return [random.choice([0, 1]) for i in range(bits)]
def evaluate_binary(candidate, args):
    return int("".join([str(c) for c in candidate]), 2)

rand = random.Random()
ga = =
ga.terminator =
final_pop = ga.evolve(evaluator=evaluate_binary,
for ind in final_pop:


  • Requires at least Python 2.6+ or 3+.
  • Numpy and Pylab are required for several functions in ec.observers.
  • Pylab and Matplotlib are required for several functions in ec.analysis.
  • Parallel Python (pp) is required if ec.evaluators.parallel_evaluation_pp is used.


This package is distributed under the MIT License. This license can be found online at

Project details

Download files

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

Files for inspyred, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size inspyred-1.0.1-py2.py3-none-any.whl (88.7 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size inspyred-1.0.1.tar.gz (58.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page