{"id":48576166,"url":"https://github.com/eggachecat/elc-flow-engine","last_synced_at":"2026-04-08T15:43:41.881Z","repository":{"id":57426009,"uuid":"228545922","full_name":"eggachecat/elc-flow-engine","owner":"eggachecat","description":null,"archived":false,"fork":false,"pushed_at":"2019-12-20T08:29:20.000Z","size":160,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-08T15:43:40.839Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eggachecat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-17T06:12:36.000Z","updated_at":"2019-12-20T08:29:22.000Z","dependencies_parsed_at":"2022-09-11T10:11:55.989Z","dependency_job_id":null,"html_url":"https://github.com/eggachecat/elc-flow-engine","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/eggachecat/elc-flow-engine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggachecat%2Felc-flow-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggachecat%2Felc-flow-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggachecat%2Felc-flow-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggachecat%2Felc-flow-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eggachecat","download_url":"https://codeload.github.com/eggachecat/elc-flow-engine/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggachecat%2Felc-flow-engine/sbom","scorecard":{"id":368664,"data":{"date":"2025-08-11","repo":{"name":"github.com/eggachecat/elc-flow-engine","commit":"3b0c8f7154a0d302958722f1dccfb2448062fc3b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.6,"checks":[{"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":"Code-Review","score":0,"reason":"Found 0/12 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":"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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"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":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"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":"Vulnerabilities","score":2,"reason":"8 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-2020-73"],"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-18T12:28:20.001Z","repository_id":57426009,"created_at":"2025-08-18T12:28:20.001Z","updated_at":"2025-08-18T12:28:20.001Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31562696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"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":[],"created_at":"2026-04-08T15:43:41.259Z","updated_at":"2026-04-08T15:43:41.874Z","avatar_url":"https://github.com/eggachecat.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":" # elcflow\n \n [![Build Status](https://travis-ci.com/eggachecat/elc-flow-engine.svg?branch=master)](https://travis-ci.com/eggachecat/elc-flow-engine)\n [![PyPI version](https://badge.fury.io/py/elc-flow.svg)](https://badge.fury.io/py/elc-flow)\n [![Coverage Status](https://coveralls.io/repos/github/eggachecat/elc-flow-engine/badge.svg)](https://coveralls.io/github/eggachecat/elc-flow-engine)\n [![Documentation Status](https://readthedocs.org/projects/elc-flow-engine/badge/?version=latest)](https://elc-flow-engine.readthedocs.io)\n\n \n ## 介绍\n ELC使用\n  \n ## 指令\n ### 生成文档\n  \u003e cd docs \u0026\u0026 sphinx-apidoc -o source ../elcflow/ \u0026\u0026 make html  \n ### 测试\n  \u003e pytest --cov=elcflow\n \n ## 使用[V2]\n ### 注册算子\n 使用`register_elc_function_v2`来注册是一个算子,算子包含以下属性:\n - name\n    - 唯一的标识符,用来找到这个算子\n - parameters\n    - 字典类型, 包含了默认的参数\n    - 主要适用于例如指数函数,其指数当作参数\n        - 给指数2 -\u003e 平方\n        \n算子的输入和输出被严格规定\n    - 输入\n        - global_states\n            - 全局的一个state是一个字典\n        - result\n            - 前一个节点的结果\n        - parameters\n            - 参数\n    - 输出\n        - 一定是一个字典\n ### 用例\n```python\nfrom elcflow.base import register_elc_function_v2\n\n@register_elc_function_v2(name='elc_select_data_v2')\ndef elc_select_data_v2(global_states, result, parameters):\n    return {'return': global_states[parameters['key']]}\n\n\n@register_elc_function_v2(name='elc_add_plus_plus_v2')\ndef elc_add_plus_plus_v2(global_states, result, parameters):\n    return {'return': result['return'] + 1}\n\n\n@register_elc_function_v2(name='elc_mul_v2')\ndef elc_mul_v2(global_states, result, parameters):\n    _result = result['return'] * int(global_states['multiplier'])\n    global_states['elc_mul_v2_result'] = _result\n    return {'return': _result}\n\n\n@register_elc_function_v2(name='elc_pow_for_mul_v2')\ndef elc_pow_for_mul_v2(global_states, result, parameters):\n    _result = global_states['elc_mul_v2_result'] ** int(parameters['a'])\n    global_states['elc_pow_for_mul_v2_result'] = _result\n    return {'return': _result}\n```\n\n### 图\n#### 数据结构\n图主要由以下两部分组成\n- nodes\n    - 包含了所有的节点的信息\n    - id\n    - label\n    - 类型\n        - 数据类型\n        - 算子类型\n    - 其他\n        - 例如算子的参数\n- edges\n    - 有方向的边,从一个node的数据流向另一个node\n    - id\n    - source\n        - 起始节点的id\n    - target\n        - 结束节点的id\n#### 例子      \n```python\nfrom elcflow.graph import *\nfrom elcflow.graph import *\nfrom elcflow.helpers import json_stringify, json_parse\n\n_model_2_globals = {\n    \"global_variable_1\": 5,\n    \"multiplier\": 3\n}\n\n_model_dict_v2 = {\n    \"nodes\": [\n        {\"label\": \"data-selector\", \"id\": \"0ea5a129\", \"_elc_node_type\": 'operator', \"_elc_function\": 'elc_select_data_v2', \"_elc_parameters\": {\"key\": \"global_variable_1\"}},\n        {\"label\": \"add_plus_plus\", \"id\": \"8ac87236\", \"_elc_node_type\": 'operator', \"_elc_function\": \"elc_add_plus_plus_v2\"},\n        {\"label\": \"multiplier x\", \"id\": \"0d1af6ff\", \"_elc_node_type\": 'operator', \"_elc_function\": \"elc_mul_v2\"},\n        {\"label\": \"pow_for_mul\", \"id\": \"9d1af6ff\", \"_elc_node_type\": 'operator', \"_elc_function\": \"elc_pow_for_mul_v2\", \"_elc_parameters\": {\"a\": 4}},\n    ],\n    \"edges\": [\n        {\"source\": \"0ea5a129\", \"target\": \"8ac87236\", \"id\": \"74bc97ca\"},\n        {\"source\": \"8ac87236\", \"target\": \"0d1af6ff\", \"id\": \"d3645364\"},\n        {\"source\": \"0d1af6ff\", \"target\": \"9d1af6ff\", \"id\": \"b0eb9a9b\"},\n    ]\n}\n# 从json结构parse成图\n_graph = ELCGraph.create_from_elc_json(_model_dict_v2, elc_graph_version=ELC_GRAPH_VERSION_V2)\n# 并且初始化global\n_graph.set_state(_globals=_model_2_globals)\n# 编译图: 包含了对于节点拓扑排序并且初始化的工作\n_graph.compile()\n# 执行图\n_graph.execute()\n# 画图\n_graph.plot(show=True, with_state=True)\n\n```\n\n![Example Graph 2](./images/example-graph-2.png)\n \n \n ## 使用[V1]\n ### 注册算子\n 使用`register_elc_function`来注册是一个算子,算子包含以下属性:\n - name\n    - 唯一的标识符,用来找到这个算子\n - outputs\n    - list\n    - 给输出取名字(在图上徐)\n    - 对应到是节点输出的id\n - inputs\n    - 不可选, 则使用函数中定义的名称\n    - 对应到是节点输入的id\n - parameters\n    - 字典类型, 包含了默认的参数\n    - 主要适用于例如指数函数,其指数当作参数\n        - 给指数2 -\u003e 平方\n ### 用例\n```python\nfrom elcflow.base import register_elc_function\n@register_elc_function(outputs=['elc_output'], name='elc_exp_and_plus', parameters={'x': 5})\n# 一个例子\n# 表明注册了一个名称为elc_exp_and_plus算子\n# 他的输入有[a,b,x]\n# 其中x是参数给的默认值是5\n# 它输出的名字叫做elc_output\ndef elc_exp_and_plus_(a, b, x=2):\n    return a ** x + b ** x\n```\n\n### 图\n#### 数据结构\n图主要由以下两部分组成\n- nodes\n    - 包含了所有的节点的信息\n    - id\n    - label\n    - 类型\n        - 数据类型\n        - 算子类型\n    - 其他\n        - 例如算子的参数\n- edges\n    - 有方向的边,从一个node的*某一个输出*数据流向另一个node的*某一个输入*\n    - id\n    - source\n        - 起始节点的id\n    - target\n        - 结束节点的id\n    - _elc_source_output_id\n        - 起始节点输出的id\n            - 可能有多个输出, 取哪一个?\n    - __elc_target_input_id\n        - 结束节点输入的id\n            - 可能有多个输入, 对应到哪一个?\n#### 例子      \n```python\nfrom elcflow.graph import *\nfrom elcflow.graph import *\nfrom elcflow.helpers import json_stringify, json_parse\n\njson_model = {\n    \"nodes\": [\n        {\"label\": \"Input-2\", \"id\": \"3362b879\", \"_elc_node_type\": 'data'},\n        {\"label\": \"Input-1\", \"id\": \"0ea5a129\", \"_elc_node_type\": 'data'},\n        {\"label\": \"Add\", \"id\": \"8ac87236\", \"_elc_node_type\": 'operator', \"_elc_function\": \"elc_add\"},\n        {\"label\": \"MUL\", \"id\": \"0d1af6ff\", \"_elc_node_type\": 'operator', \"_elc_function\": \"elc_mul\"},\n        {\"label\": \"POW\", \"id\": \"9d1af6ff\", \"_elc_node_type\": 'operator', \"_elc_function\": \"elc_pow\", \"_elc_parameters\": {\"a\": 4}},\n        {\"label\": \"OUTPUT\", \"id\": \"1d1af6ff\", \"_elc_node_type\": 'operator', \"_elc_function\": \"elc_output\", },\n        {\"label\": \"OUTPUT\", \"id\": \"2d1af6ff\", \"_elc_node_type\": 'operator', \"_elc_function\": \"elc_output\"},\n    ],\n    \"edges\": [\n        {\"source\": \"0ea5a129\", \"target\": \"8ac87236\", \"id\": \"74bc97ca\", \"_elc_source_output_id\": '', \"_elc_target_input_id\": \"a\"},\n        {\"source\": \"3362b879\", \"target\": \"8ac87236\", \"id\": \"d3645364\", \"_elc_source_output_id\": '', \"_elc_target_input_id\": \"b\"},\n        {\"source\": \"8ac87236\", \"target\": \"0d1af6ff\", \"id\": \"b0eb9a9b\", \"_elc_source_output_id\": 'sum_result', \"_elc_target_input_id\": \"a\"},\n        {\"source\": \"3362b879\", \"target\": \"0d1af6ff\", \"id\": \"0e6c0fde\", \"_elc_source_output_id\": '', \"_elc_target_input_id\": \"b\"},\n        {\"source\": \"0d1af6ff\", \"target\": \"9d1af6ff\", \"id\": \"7e6c0fde\", \"_elc_source_output_id\": 'mul_result', \"_elc_target_input_id\": \"x\"},\n        {\"source\": \"0d1af6ff\", \"target\": \"1d1af6ff\", \"id\": \"1e6c0fde\", \"_elc_target_input_id\": \"kwargs\"},\n        {\"source\": \"9d1af6ff\", \"target\": \"2d1af6ff\", \"id\": \"2e6c0fde\", \"_elc_target_input_id\": \"kwargs\"},\n    ]\n}\n# 从json结构parse成图\n_graph = ELCGraph.create_from_elc_json(json_model)\n# 编译图: 包含了对于节点拓扑排序并且初始化的工作\n_graph.compile()\n# 把输入节点的数据喂进去\n_graph.feed_data_dict({\n    '3362b879': 5,\n    '0ea5a129': 6\n})\n# 执行图\n_graph.execute()\n# 序列化整个图结构\ngraph_str = json_stringify(_graph.to_dict())\n# 解析序列化结构到图\nnew_graph = ELCGraph.load(json_parse(graph_str))\n# 把结果画出来\nnew_graph.plot(show=True, with_state=True)\n```\n\n![Example Graph 1](./images/example-graph-1.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggachecat%2Felc-flow-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feggachecat%2Felc-flow-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggachecat%2Felc-flow-engine/lists"}