semvec/pypi-packages huggingface dataset:
pygena 0.2.0
A simple genetic algorithm library in Python.
License: MIT
Requires Python: >=3.7

# pygena

A simple, flexible genetic algorithm library for Python. Easily define your own chromosomes, fitness functions, and evolutionary strategies to solve optimization and search problems.

## Features
- Minimal, intuitive API
- Customizable chromosomes and fitness functions
- Population management and evolution

## Installation
```bash
pip install pygena
```
Or clone and install from source:
```bash
git clone https://github.com/atasoglu/pygena.git
cd pygena
pip install .
```

## Usage
Here's a minimal example of evolving a list of numbers to sum to a target:
```python
from pygena import Chromosome, Population
import random

target = 100
chromosome_size = 10
population_size = 10
mutation_rate = 0.05
iterations = 100

def random_int(gene=None):
    return random.randint(-100, 100)

def random_list():
    return [random_int() for _ in range(chromosome_size)]

def fitness_fn(chromosome):
    diff = abs(sum(chromosome.genes) - target)
    return 1 / (diff + 1e-5)

random.seed(42)
population = Population(
    chromosomes=[Chromosome(random_list()) for _ in range(population_size)],
    mutation_rate=mutation_rate,
    mutation_fn=random_int,
)
for i, local_best, global_best in population.run(iterations, fitness_fn):
    print(f"Iteration {i}: {global_best.genes} (sum: {sum(global_best.genes)})")
    if sum(global_best.genes) == target:
        print(f"Target reached in {i} iterations.")
        break
```

For more examples, see the [`examples/`](pygena/examples/) directory.

You can simply run an example script: `python3 -m pygena.examples.text`. Run with the `--help` flag to see the full list of arguments.

## Contributing
Contributions are welcome! Feel free to open issues or submit pull requests to help improve pygena.

## License
MIT License. See [LICENSE](LICENSE).
invenio-config 1.1.0
"Invenio configuration loader."
License: MIT
Requires Python: >=3.7
Keywords: invenio config

..
    This file is part of Invenio.
    Copyright (C) 2015-2018 CERN.

    Invenio is free software; you can redistribute it and/or modify it
    under the terms of the MIT License; see LICENSE file for more details.

================
 Invenio-Config
================

.. image:: https://img.shields.io/github/license/inveniosoftware/invenio-config.svg
        :target: https://github.com/inveniosoftware/invenio-config/blob/master/LICENSE

.. image:: https://github.com/inveniosoftware/invenio-config/workflows/CI/badge.svg
        :target: https://github.com/inveniosoftware/invenio-config/actions

.. image:: https://img.shields.io/coveralls/inveniosoftware/invenio-config.svg
        :target: https://coveralls.io/r/inveniosoftware/invenio-config

.. image:: https://img.shields.io/pypi/v/invenio-config.svg
        :target: https://pypi.org/pypi/invenio-config


Invenio configuration loader.

Invenio-Config is a base package of the Invenio digital library framework. It
is usually installed automatically as a dependency. It facilitates
configuration loading from various sources such as a Python module, an instance
folder or environment variables.

Further documentation is available on https://invenio-config.readthedocs.io/.

..
    This file is part of Invenio.
    Copyright (C) 2015-2024 CERN.
    Copyright (C) 2025 Graz University of Technology.

    Invenio is free software; you can redistribute it and/or modify it
    under the terms of the MIT License; see LICENSE file for more details.

Changes
=======

Version 1.1.0 (released 2025-07-01)

- fix: pkg_resources DeprecationWarning
- setup: change to reusable workflows
- chore: remove unnecessary __future__ imports
- ci: use shared workflow for Python tests
- style: autoformat with black
- deps: update pytest-black and pytest-invenio versions

Version 1.0.4 (released 2024-01-28)

- Allow table HTML tags for sanitization

Version 1.0.3 (released 2020-05-06)

- Deprecated Python versions lower than 3.6.0. Now supporting 3.6.0 and 3.7.0.

Version 1.0.2 (released 2019-07-29)

- Added `ALLOWED_HTML_TAGS` and `ALLOWED_HTML_ATTRS` config keys.

Version 1.0.1 (released 2018-10-02)

- Application configurations are now sorted and loaded in alphabetical order.

Version 1.0.0 (released 2018-03-23)

- Initial public release.