{"id":22940574,"url":"https://github.com/3mp3ri0r/cpyfunctional","last_synced_at":"2025-09-11T00:44:32.844Z","repository":{"id":89604451,"uuid":"163696685","full_name":"3mp3ri0r/cpyfunctional","owner":"3mp3ri0r","description":"cpyfunctional is python package to help you code python in functional programming paradigm","archived":false,"fork":false,"pushed_at":"2019-01-01T03:54:26.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-25T01:45:00.170Z","etag":null,"topics":["functional-programming","library","python","python3"],"latest_commit_sha":null,"homepage":null,"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/3mp3ri0r.png","metadata":{"files":{"readme":"README.rst","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-12-31T20:48:51.000Z","updated_at":"2022-12-08T23:52:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"21b65e95-7903-4774-b168-63e69ead3fa1","html_url":"https://github.com/3mp3ri0r/cpyfunctional","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/3mp3ri0r/cpyfunctional","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3mp3ri0r%2Fcpyfunctional","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3mp3ri0r%2Fcpyfunctional/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3mp3ri0r%2Fcpyfunctional/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3mp3ri0r%2Fcpyfunctional/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/3mp3ri0r","download_url":"https://codeload.github.com/3mp3ri0r/cpyfunctional/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3mp3ri0r%2Fcpyfunctional/sbom","scorecard":{"id":3645,"data":{"date":"2025-08-11","repo":{"name":"github.com/3mp3ri0r/cpyfunctional","commit":"f3980190fd4b3550c9a9d47dd522a66befd5545b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"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/9 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":"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":"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":"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":"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":"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 '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":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2022-238 / GHSA-h3qr-fjhm-jphw"],"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-14T13:06:04.278Z","repository_id":89604451,"created_at":"2025-08-14T13:06:04.278Z","updated_at":"2025-08-14T13:06:04.278Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274556256,"owners_count":25307506,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-10T02:00:12.551Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["functional-programming","library","python","python3"],"created_at":"2024-12-14T13:23:37.693Z","updated_at":"2025-09-11T00:44:32.831Z","avatar_url":"https://github.com/3mp3ri0r.png","language":"Python","readme":"=============\ncpyfunctional\n=============\n:Author: Christoforus Surjoputro \u003ccs_sanmar@yahoo.com\u003e\n:Date: $Date: 2018-12-31 $\n:Version: $Version: 0.0.1 $\n:License: MIT License\n\n.. role:: python(code)\n   :language: python\n\n.. image:: https://travis-ci.org/3mp3ri0r/cpyfunctional.svg?branch=master\n    :target: https://travis-ci.org/3mp3ri0r/cpyfunctional\n\n.. image:: https://codecov.io/gh/3mp3ri0r/cpyfunctional/branch/master/graph/badge.svg\n  :target: https://codecov.io/gh/3mp3ri0r/cpyfunctional\n\n.. contents:: Table of content\n\nIntroduction\n============\n\n`cpyfunctional`_ is python package to help you code python in functional programming paradigm. `Series of article`_ by\nEric Elliot will tell you why you should code using functional programming.\n\nPython version\n--------------\n\nThis module work on 3.4+. Fully tested on python 3.5.2.\n\nHow to install\n==============\n\n.. code-block:: bash\n\n    pip install cpyfunctional\n\nHow to use\n==========\n\n1. Import cpyfunctional to your project: :python:`import cpyfunctional`.\n2. Choose action you want in :python:`cpyfunctional` package.\n\ncompose\n-------\n\n`compose`_ is a function to execute any callable one by one chaining from last callable to first. This function accept\nany callable and execute it from last callable to the first and pass every result to next callable until the last.\n\n.. code-block:: python\n\n    def inc(number: int) -\u003e int:\n        return number + 1\n\n    def square(number: int) -\u003e int:\n        return number ** 2\n\n    cpyfunctional.compose(inc, square)(3) # 10\n    cpyfunctional.compose(square, inc)(3) # 16\n\nAs you can see, it execute callable from last to first. You can also use lambda instead of creating function.\n\n.. code-block:: python\n\n    cpyfunctional.compose(lambda number: number + 1, lambda number: number ** 2)(3) # 10\n\npipe\n----\n\nThis function has same functionality to `compose`_ but execute callable from first to last.\n\n.. code-block:: python\n\n    def inc(number: int) -\u003e int:\n        return number + 1\n\n    def square(number: int) -\u003e int:\n        return number ** 2\n\n    cpyfunctional.pipe(inc, square)(3) # 16\n    cpyfunctional.pipe(square, inc)(3) # 10\n\nfunc_curry\n----------\n\n`func_curry`_ is a function to add parameter to callable that called by `compose`_ or `pipe`_. This function accept a\ncallable that accept parameter and push previous value to related callable and execute it.\n\n.. code-block:: python\n\n    def inc(number: int) -\u003e int:\n        return number + 1\n\n    def multiple(multiplier: int, prev_number: int) -\u003e int:\n        return prev_number * multiplier\n\n    cpyfunctional.compose(inc, func_curry(multiple)(6))(3) # 19\n\nThis example show that now callable are able to accept any parameter not only from previous result.\n\nHow to contribute\n=================\n\nJust create an `issue`_ when you encounter any problem or contact me personally.\n\n.. _`cpyfunctional`: https://gitlab.com/3mp3ri0r/cpyfunctional\n.. _`Series of article`: https://medium.com/javascript-scene/composing-software-an-introduction-27b72500d6ea\n.. _`issue`: https://gitlab.com/3mp3ri0r/cpyfunctional/issues\n\nNote\n====\n\nI'm not an expert in functional programming, so any input about FP like any function and/or naming and/or incorrect\nimplementation will be very helpful.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3mp3ri0r%2Fcpyfunctional","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F3mp3ri0r%2Fcpyfunctional","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3mp3ri0r%2Fcpyfunctional/lists"}