{"id":32633441,"url":"https://github.com/gigaquads/tunafish","last_synced_at":"2026-05-13T12:45:18.892Z","repository":{"id":53786987,"uuid":"344586422","full_name":"gigaquads/tunafish","owner":"gigaquads","description":"Tunafish is a high-level genetic algorithm/programming-based function auto-tuning toolkit. It figures out what the best arguments to a function should be to optimize its output with respect to an arbitrary fitness function, like a distance measure.","archived":false,"fork":false,"pushed_at":"2021-05-26T20:57:06.000Z","size":82,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-10-30T23:53:20.165Z","etag":null,"topics":["ai","autotuner","ga","genetic-algorithms","genetic-optimization-algorithm","genetic-programming","gp","machine-learning","machine-learning-library","ml","trading"],"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/gigaquads.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":"2021-03-04T19:28:24.000Z","updated_at":"2022-05-31T03:22:35.000Z","dependencies_parsed_at":"2022-09-04T18:21:51.780Z","dependency_job_id":null,"html_url":"https://github.com/gigaquads/tunafish","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gigaquads/tunafish","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gigaquads%2Ftunafish","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gigaquads%2Ftunafish/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gigaquads%2Ftunafish/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gigaquads%2Ftunafish/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gigaquads","download_url":"https://codeload.github.com/gigaquads/tunafish/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gigaquads%2Ftunafish/sbom","scorecard":{"id":426537,"data":{"date":"2025-08-11","repo":{"name":"github.com/gigaquads/tunafish","commit":"5df7a3f05c10733564339c81ab553481a8db81bd"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.1,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/23 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":3,"reason":"7 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2018-34 / GHSA-2fc2-6r4j-p65h","Warn: Project is vulnerable to: PYSEC-2021-856 / GHSA-5545-2q6w-2gh6","Warn: Project is vulnerable to: PYSEC-2019-108 / GHSA-9fq2-x9r6-wfmf","Warn: Project is vulnerable to: PYSEC-2018-33 / GHSA-cw6w-4rcx-xphc","Warn: Project is vulnerable to: PYSEC-2021-857 / GHSA-f7c7-j99h-c22f","Warn: Project is vulnerable to: GHSA-fpfv-jqm9-f5jm","Warn: Project is vulnerable to: PYSEC-2017-1 / GHSA-frgw-fgh6-9g52"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T02:21:29.071Z","repository_id":53786987,"created_at":"2025-08-19T02:21:29.071Z","updated_at":"2025-08-19T02:21:29.071Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32983697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T11:31:52.688Z","status":"ssl_error","status_checked_at":"2026-05-13T11:31:52.072Z","response_time":115,"last_error":"SSL_read: 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":["ai","autotuner","ga","genetic-algorithms","genetic-optimization-algorithm","genetic-programming","gp","machine-learning","machine-learning-library","ml","trading"],"created_at":"2025-10-30T23:51:56.308Z","updated_at":"2026-05-13T12:45:18.806Z","avatar_url":"https://github.com/gigaquads.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tunafish\n## Autotuner For Python Functions\nTunafish is an autotuner for plain ol' Python functions. Under the hood, it uses genetic algorithms to determine which arguments maximize a function's return value (i.e. it's fitness); however, Tunafish eliminates the need to think about genetic algorithms. Instead, you can focus more on just writing code.\n\nTo use Tunafish, your objective function must satisfy the following two\nconditions:\n1. Arguments *must* be annotated as primitives types, like `float`,\n`int`, `str`, and `bool`, `typing.Text`, etc.\n2. The return value *must* be expressed as a single `float` (i.e. a fitness\nvalue).\n\n## Example: Automated Trading\nConsider a function whose objective is to place orders to buy and sell stocks. The input arguments are `aggression`, which regulates the a minimum amount of time between orders, and `window`, which determines how far back the trading algorithm should looks when deciding when take action. The return value is simply the net gain or loss generated while trading, which is used as a proxy for fitness.\n\n### Define The Objective Function\n```python\nfrom example_project import create_trader, load_historical_trading_data\n\ntrader = create_trader()\ntraining_data = load_historical_trading_data(start, stop, interval)\n\ndef trade(aggression: float, window: int) -\u003e float:\n  gains = trader.trade(training_data, aggression, window)\n  return gains  # AKA fitness\n```\n\n### Tune it...\n```python\nfrom tunafish import FunctionTuner\n\ntuner = FunctionTuner()\narguments = tuner.tune(trade, options={\n  'aggression': {'min': 0.01, 'max': 1.0},\n  'window': {'min': 5, 'max': 20}\n})\n```\n\n## More Examples\nWorking examples can be found in `tunafish.examples`. The \"basic\" and \"early_stopping\" examples differ only in that \"early_stopping\" shows you how to control a bit more of the internals of the genetic algorithm. In particular, we tell it to exit the training loop early if we reach a fitness goal before all 500 epochs have run. Running these examples should generate a plot, showing convergence of fitness versus time.\n\n![Max Fitness Per Epoch Graph](./docs/assets/fitness-per-epoch.png)\n\n### Running Examples\nJust do `python -m tunafish.examples.basic`!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgigaquads%2Ftunafish","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgigaquads%2Ftunafish","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgigaquads%2Ftunafish/lists"}