{"id":32174636,"url":"https://github.com/aresio/simpful","last_synced_at":"2026-02-21T12:01:28.516Z","repository":{"id":50351904,"uuid":"150426227","full_name":"aresio/simpful","owner":"aresio","description":"A friendly python library for fuzzy logic reasoning","archived":false,"fork":false,"pushed_at":"2025-07-25T14:08:44.000Z","size":6082,"stargazers_count":142,"open_issues_count":10,"forks_count":37,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-12-11T00:37:40.033Z","etag":null,"topics":["api","fuzzy-logic","mamdani","sugeno"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"afl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aresio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-09-26T12:52:25.000Z","updated_at":"2025-12-03T14:19:58.000Z","dependencies_parsed_at":"2024-01-14T23:30:21.917Z","dependency_job_id":"0bce0fd5-ff20-4f8f-b9c7-2382f9e6e7fa","html_url":"https://github.com/aresio/simpful","commit_stats":{"total_commits":210,"total_committers":8,"mean_commits":26.25,"dds":0.7095238095238094,"last_synced_commit":"d3661eaeb69a290e5482388d88f18bfc928d5ae7"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/aresio/simpful","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aresio%2Fsimpful","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aresio%2Fsimpful/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aresio%2Fsimpful/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aresio%2Fsimpful/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aresio","download_url":"https://codeload.github.com/aresio/simpful/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aresio%2Fsimpful/sbom","scorecard":{"id":206191,"data":{"date":"2025-08-11","repo":{"name":"github.com/aresio/simpful","commit":"e1b6b534f0fefac517dfffc765386a2b05fcd875"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.1,"checks":[{"name":"Maintained","score":5,"reason":"6 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":1,"reason":"Found 2/17 approved changesets -- score normalized to 1","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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/python-package.yml:1","Warn: no topLevel permission defined: .github/workflows/python-publish.yml:1","Info: no jobLevel write permissions found"],"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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"Pinned-Dependencies","score":1,"reason":"dependency not pinned by hash detected -- score normalized to 1","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-package.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/aresio/simpful/python-package.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-package.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/aresio/simpful/python-package.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/aresio/simpful/python-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/aresio/simpful/python-publish.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:28","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:29","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:30","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:29","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:30","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   5 pipCommand dependencies pinned"],"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Academic Free License v3.0: 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 'master'"],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 15 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"}},{"name":"Vulnerabilities","score":0,"reason":"10 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","Warn: Project is vulnerable to: PYSEC-2019-156 / GHSA-xp76-357g-9wqq","Warn: Project is vulnerable to: PYSEC-2023-102","Warn: Project is vulnerable to: PYSEC-2023-114"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T23:50:03.928Z","repository_id":50351904,"created_at":"2025-08-16T23:50:03.928Z","updated_at":"2025-08-16T23:50:03.928Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29680147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T11:29:27.227Z","status":"ssl_error","status_checked_at":"2026-02-21T11:29:20.292Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["api","fuzzy-logic","mamdani","sugeno"],"created_at":"2025-10-21T19:02:57.593Z","updated_at":"2026-02-21T12:01:28.485Z","avatar_url":"https://github.com/aresio.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Python package](https://github.com/aresio/simpful/workflows/Python%20package/badge.svg?branch=master)\n[![Documentation Status](https://readthedocs.org/projects/simpful/badge/?version=latest)](https://simpful.readthedocs.io/en/latest/?badge=latest)\n\n# simpful\nA Python library for fuzzy logic reasoning, designed to provide a simple and lightweight API, as close as possible to natural language.\nSimpful supports Mamdani and Sugeno reasoning of any order, parsing any complex fuzzy rules involving AND, OR, and NOT operators, using arbitrarily shaped fuzzy sets.\nFor more information on its usage, try out the example scripts in this repository or check our [online documentation](https://simpful.readthedocs.io/en/latest/).\n\n## Installation\n\n`pip install simpful`\n\n## Citing Simpful\n\nIf you find Simpful useful for your research, please cite our work as follows:\n\nSpolaor S., Fuchs C., Cazzaniga P., Kaymak U., Besozzi D., Nobile M.S.: Simpful: a user-friendly Python library for fuzzy logic, International Journal of Computational Intelligence Systems, 13(1):1687–1698, 2020\n[DOI:10.2991/ijcis.d.201012.002](https://doi.org/10.2991/ijcis.d.201012.002)\n\n## Usage example 1: controlling a gas burner with a Takagi-Sugeno fuzzy system\n\nThis example shows how to specify the information about the linguistic variables, fuzzy sets, fuzzy rules, and input values to Simpful. The last line of code prints the result of the fuzzy reasoning.\n\n\n```\nimport simpful as sf\n\n# A simple fuzzy model describing how the heating power of a gas burner depends on the oxygen supply.\n\nFS = sf.FuzzySystem()\n\n# Define a linguistic variable.\nS_1 = sf.FuzzySet( points=[[0, 1.],  [1., 1.],  [1.5, 0]],          term=\"low_flow\" )\nS_2 = sf.FuzzySet( points=[[0.5, 0], [1.5, 1.], [2.5, 1], [3., 0]], term=\"medium_flow\" )\nS_3 = sf.FuzzySet( points=[[2., 0],  [2.5, 1.], [3., 1.]],          term=\"high_flow\" )\nFS.add_linguistic_variable(\"OXI\", sf.LinguisticVariable( [S_1, S_2, S_3] ))\n\n# Define consequents.\nFS.set_crisp_output_value(\"LOW_POWER\", 0)\nFS.set_crisp_output_value(\"MEDIUM_POWER\", 25)\nFS.set_output_function(\"HIGH_FUN\", \"OXI**2\")\n\n# Define fuzzy rules.\nRULE1 = \"IF (OXI IS low_flow) THEN (POWER IS LOW_POWER)\"\nRULE2 = \"IF (OXI IS medium_flow) THEN (POWER IS MEDIUM_POWER)\"\nRULE3 = \"IF (NOT (OXI IS low_flow)) THEN (POWER IS HIGH_FUN)\"\nFS.add_rules([RULE1, RULE2, RULE3])\n\n# Set antecedents values, perform Sugeno inference and print output values.\nFS.set_variable(\"OXI\", .51)\nprint (FS.Sugeno_inference(['POWER']))\n```\n\n## Usage example 2: tipping with a Mamdani fuzzy system \n\nThis second example shows how to model a FIS using Mamdani inference. It also shows some facilities \nthat make modeling more concise and clear: automatic Triangles (i.e., pre-baked linguistic variables \nwith equally spaced triangular fuzzy sets) and the automatic detection of the inference method.\n\n```\nfrom simpful import *\n\nFS = FuzzySystem()\n\nTLV = AutoTriangle(3, terms=['poor', 'average', 'good'], universe_of_discourse=[0,10])\nFS.add_linguistic_variable(\"service\", TLV)\nFS.add_linguistic_variable(\"quality\", TLV)\n\nO1 = TriangleFuzzySet(0,0,13,   term=\"low\")\nO2 = TriangleFuzzySet(0,13,25,  term=\"medium\")\nO3 = TriangleFuzzySet(13,25,25, term=\"high\")\nFS.add_linguistic_variable(\"tip\", LinguisticVariable([O1, O2, O3], universe_of_discourse=[0,25]))\n\nFS.add_rules([\n\t\"IF (quality IS poor) OR (service IS poor) THEN (tip IS low)\",\n\t\"IF (service IS average) THEN (tip IS medium)\",\n\t\"IF (quality IS good) OR (service IS good) THEN (tip IS high)\"\n\t])\n\nFS.set_variable(\"quality\", 6.5) \nFS.set_variable(\"service\", 9.8) \n\ntip = FS.inference()\n```\n## Usage example 3: fuzzy sets naming\n\nThis example shows how to automatically assign names to fuzzy sets. Such a tool can be handy when dealing with\nautomatically genereted Fuzzy Systems.\n\n```\nfrom simpful import *\nfrom simpful.cluster_labeling import approximate_fs_labels\n\n# ------ EXAMPLE FUZZY SYSTEM ------\nFS = FuzzySystem()\n\n# Input Variable 1: Temperature\nT_S1 = FuzzySet(function=Gaussian_MF(mu=0, sigma=8), term=\"cold\")\nT_S2 = FuzzySet(function=Gaussian_MF(mu=40, sigma=8), term=\"hot\")\nTemperature = LinguisticVariable([T_S1, T_S2], concept=\"Temperature\", universe_of_discourse=[0, 40])\nFS.add_linguistic_variable(\"Temperature\", Temperature)\n\n# Input Variable 2: Humidity\nH_S1 = FuzzySet(function=Gaussian_MF(mu=0, sigma=20), term=\"dry\")\nH_S2 = FuzzySet(function=Gaussian_MF(mu=100, sigma=20), term=\"wet\")\nHumidity = LinguisticVariable([H_S1, H_S2], concept=\"Humidity\", universe_of_discourse=[0, 100])\nFS.add_linguistic_variable(\"Humidity\", Humidity)\n\n# Output Variable\nF_S1 = FuzzySet(function=Gaussian_MF(mu=0, sigma=25), term=\"slow\")\nF_S2 = FuzzySet(function=Gaussian_MF(mu=100, sigma=25), term=\"fast\")\nFanSpeed = LinguisticVariable([F_S1, F_S2], concept=\"Fan Speed\", universe_of_discourse=[0, 100])\n\nR1 = \"IF (Temperature IS hot) AND (Humidity IS wet) THEN (FanSpeed IS fast)\"\nR2 = \"IF (Temperature IS cold) THEN (FanSpeed IS slow)\"\nFS.add_rules([R1, R2])\n\n# ------ USAGE EXAMPLE ------\n# The generate_report parameter allows the creation of a PDF report with graphs and rules.\n# The plot_color_by_rule_output allows to color membership functions based on their rule effect\napproximate_fs_labels(FS, output_path=\"output\", generate_report=False, plot_color_by_rule_output=True)\n```\n\n## Additional examples\n\nAdditional example scripts are available in the [examples folder](https://github.com/aresio/simpful/tree/master/examples) of this GitHub and in our [Code Ocean capsule](https://codeocean.com/capsule/2230971/tree).\n\n## Further info\nCreated by Marco S. Nobile at the Eindhoven University of Technology and Simone Spolaor at the University of Milano-Bicocca. \n\nIf you need further information, please write an e-mail at: marco.nobile@unive.it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faresio%2Fsimpful","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faresio%2Fsimpful","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faresio%2Fsimpful/lists"}