A Python implementation of genetic algorithms.
Install this package using pip:
pip install -e git+https://github.com/javidahmed64592/genetic-algorithm#egg=genetic_algorithm
To update the package:
pip update -e git+https://github.com/javidahmed64592/genetic-algorithm#egg=genetic_algorithm
Note: It is recommended to install this into a virtual environment.
This repository is managed using the uv Python project manager: https://docs.astral.sh/uv/
To install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh # Linux/Mac
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" # WindowsInstall the required dependencies using pip:
uv sync
To install with dev dependencies:
uv sync --extra dev
For an example of how to use the genetic algorithm, see examples/phrase_solver.ipynb where it is used to generate a specific sentence from random characters.
- Run tests:
uv run pytest - Lint code:
uv run ruff check . - Format code:
uv run ruff format . - Type check:
uv run mypy .
This project is licensed under the MIT License - see the LICENSE file for details.