Skip to main content

GeneticPy

codecov PyPI version PyPI pyversions PyPI Downloads

GeneticPy is an optimizer that uses a genetic algorithm to quickly search through custom parameter spaces for optimal solutions.

Installation

GeneticPy requires Python 3.10+

pip install geneticpy

Development Workflow

This project uses uv for fast dependency management and hatchling as the build backend.

# Run tests
make test

# Build the package
make build

Optimize Example:

A brief example to get you started is included below:

import geneticpy

def loss_function(params):
  if params['type'] == 'add':
    return params['x'] + params['y']
  elif params['type'] == 'multiply':
    return params['x'] * params['y']

param_space = {'type': geneticpy.ChoiceDistribution(choice_list=['add', 'multiply']),
               'x': geneticpy.UniformDistribution(low=5, high=10, q=1),
               'y': geneticpy.GaussianDistribution(mean=0, standard_deviation=1)}

results = geneticpy.optimize(loss_function, param_space, size=200, generation_count=500, verbose=True)
best_params = results.best_params
loss = results.best_score
total_time = results.total_time

PyPi Project

https://pypi.org/project/geneticpy/

Contact

Please feel free to email me at brandonschabell@gmail.com with any questions or feedback.

Metadata

Release files for geneticpy 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for geneticpy 2.0.0
File Size Uploaded Provenance Actions
geneticpy-2.0.0.tar.gz 14.5 kB Without provenance Details for geneticpy-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for geneticpy 2.0.0
File Interpreter ABI Platform Actions
geneticpy-2.0.0-py3-none-any.whl Python 3 none any Details for geneticpy-2.0.0-py3-none-any.whl

Total release size: 28.4 kB

Release files / geneticpy-2.0.0.tar.gz

Download URL geneticpy-2.0.0.tar.gz
Size 14.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4d44e4faf0c5d5856f68879633ba955de7fbce6b049254a0b900de5cb8611e97
BLAKE2b-256 checksum
How to use checksums
78062147b6801ba35db5eb5071430c62425adc8d0ac40b3c51af62dbed901564
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / geneticpy-2.0.0-py3-none-any.whl

Download URL geneticpy-2.0.0-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
75b91ad98afbc4c0b00b0821bd4ee33532ba6c3c98023d301105aab99b2c6bb7
BLAKE2b-256 checksum
How to use checksums
8bad56b460408a46d513ef447c349728a8d327b1ddea9e994528cef8951e55cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Security for geneticpy 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page