--- id: deap version: "1.4.4" license: LGPL license_treatment: copyleft maintenance: active --- # deap — Distributed Evolutionary Algorithms in Python License: copyleft · Maintenance: active · Downloads: 500.4K/mo ## What it is and what it does DEAP is a framework for building evolutionary algorithms in Python. It provides building blocks for genetic algorithms, genetic programming, evolution strategies (including CMA-ES), and multi-objective optimization (NSGA-II, NSGA-III, SPEA2, MO-CMA-ES). The framework emphasizes making algorithms explicit and data structures transparent, allowing you to work with any representation—lists, arrays, sets, dictionaries, trees, or numpy arrays. It integrates with numpy and moocore for numerical operations and multi-objective tasks. The package is designed for rapid prototyping and testing of evolutionary ideas. It includes utilities like a Hall of Fame for tracking the best individuals, checkpoints for system snapshots, benchmarks with common test functions, and genealogy tracking compatible with NetworkX. DEAP supports parallelization of fitness evaluations through mechanisms like multiprocessing and SCOOP, making it suitable for computationally intensive optimization problems. Use it for: - Implement a genetic algorithm to optimize parameters for a machine learning model or engineering design - Solve multi-objective optimization problems where multiple competing objectives must be balanced - Develop genetic programming solutions to evolve symbolic expressions or program trees for regression or classification - Run evolution strategies like CMA-ES for continuous optimization of high-dimensional problems - Prototype particle swarm optimization or differential evolution algorithms for comparison studies ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. DEAP is an evolutionary computation framework for implementing genetic algorithms, genetic programming, evolution strategies, and multi-objective optimization with support for arbitrary data structures and parallelization. Yes. DEAP is actively maintained, has low install friction, carries no known vulnerabilities, and is widely used in research and industry for evolutionary computation. The LGPL license is standard for research software and poses no barrier for most use cases. Install it if you need a mature, flexible framework for genetic algorithms, genetic programming, or multi-objective optimization. ## Install pip install deap uv add deap poetry add deap ## Installing deap Before you install: Low install friction with a pure-Python wheel distribution. Actively maintained with a release within the last 119 days. Depends on numpy and moocore, both widely available. License in practice: DEAP is licensed under LGPL (copyleft), which requires that derivative works and modifications remain under the same license, though linking from proprietary code is permitted under the library exception. Quickstart: pip install deap from deap import creator, base, tools, algorithms import random creator.create("FitnessMax", base.Fitness, weights=(1.0,)) creator.create("Individual", list, fitness=creator.FitnessMax) toolbox = base.Toolbox() toolbox.register("attr_bool", random.randint, 0, 1) toolbox.register("individual", tools.initRepeat, creator.Individual, toolbox.attr_bool, n=100) population = toolbox.population(n=300) Verify before relying: - Whether moocore is a required runtime dependency or only needed for specific multi-objective optimization features - Current Python version support range (requires_python not specified in metadata) ## Package facts - License: LGPL (copyleft) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 500.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags genetic algorithm framework, evolutionary computation python, genetic programming library, multi-objective optimization, cma-es implementation, particle swarm optimization, differential evolution, optimization, evolutionary-algorithms, parallelizable [View on SkillFed](https://skillfed.io/packages/deap) · [View on PyPI](https://pypi.org/project/deap/)