{"id":39282445,"url":"https://github.com/subatiq/genetica","last_synced_at":"2026-01-18T01:03:48.821Z","repository":{"id":57433554,"uuid":"159662286","full_name":"subatiq/genetica","owner":"subatiq","description":"Minimalistic optimization library based on genetic algorithms. Available via pip.","archived":false,"fork":false,"pushed_at":"2020-07-27T09:34:14.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-25T11:48:09.399Z","etag":null,"topics":["genetic-algorithm-library","optimization","optimization-algorithms","pip","pypi"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/subatiq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-29T12:23:40.000Z","updated_at":"2020-07-29T20:35:02.000Z","dependencies_parsed_at":"2022-08-28T04:41:06.845Z","dependency_job_id":null,"html_url":"https://github.com/subatiq/genetica","commit_stats":null,"previous_names":["vasemenov/genetica"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/subatiq/genetica","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subatiq%2Fgenetica","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subatiq%2Fgenetica/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subatiq%2Fgenetica/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subatiq%2Fgenetica/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/subatiq","download_url":"https://codeload.github.com/subatiq/genetica/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subatiq%2Fgenetica/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28525462,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"ssl_error","status_checked_at":"2026-01-18T00:39:39.467Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["genetic-algorithm-library","optimization","optimization-algorithms","pip","pypi"],"created_at":"2026-01-18T01:03:48.237Z","updated_at":"2026-01-18T01:03:48.808Z","avatar_url":"https://github.com/subatiq.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Genetica\n\n## About\n\n**Genetica** is the minimalistic genetic algorithm library for optimizing class parameters.\n\nThis library allows you to take any class with certain business logic, modify it a little and then give it back to Genetica to optimize.\n\nRight now Genetica is a *minimalistic* library. It lacks some of the fancy aspects of genetic algorithms. Nevertheless, the library was created to optimize some aerospace designs for the author's graduation project.\n\nNow you can enjoy the core idea of genetic optimization without much pain of getting into it:\n\n- Turning class parameters into manipulatable genes\n- Population generation (any size)\n- Crossbreeding with mutations\n- Learning process chart (not real-time)\n- Real-time learning feedback\n- Getting the best and worst species' parameters\n\n## Installation\n\nGenetica is supported by Pyhton 3.x\n\nInstall it through pip:\n    \n    pip install genetica\n\n## Quick start\n\n### Imports\n```python\nfrom genetica.model import Genetica\nfrom genetica.dna import genify\n```\n\n### Class structure\n\n```python\nclass ExampleModel:\n    def __init__(self, dna):\n        self.dna = dna\n\n        # Class parameters that are inputs for optimization\n        self.a1 = genify(range(1,1890), dna.genes[0])\n        self.a2 = genify(range(1,2017), dna.genes[1])\n\n        #                 | enum of         | just get a\n        #                    possible        certain gen\n        #                        params |    to randomize \n        #                 |             |    this parameter|   \n        #                 |             |   |              |\n        #self.a2 = genify( range(1,2017),      dna.genes[1] )\n\n        # Target parameter to optimize\n        self.result = self.fitness()\n        \n    def fitness(self):\n        return self.a1 ** self.a1 + self.a1 * self.a2 + self.a2\n\n```\n\n### Running optimization\n```python\nmodel = Genetica(ExampleModel, 2, 1000, lambda x: x.result)\nmodel.run()\n```\n\n\n### Getting results\n```python\nprint(\"BEST FIT:\", model.get_best_fit())\nprint(\"PARAMS OF BEST FIT:\", model.get_best_specie().a1, model.get_best_specie().a2)\n\n# Getting populations history of best results for each epoch\nmodel.plot()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubatiq%2Fgenetica","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsubatiq%2Fgenetica","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubatiq%2Fgenetica/lists"}