{"id":24316477,"url":"https://github.com/jferard/yamft","last_synced_at":"2025-10-07T09:32:06.128Z","repository":{"id":170593589,"uuid":"168757313","full_name":"jferard/yamft","owner":"jferard","description":"YAMFT (Yet another `more-functools`) is another functional library for Python","archived":false,"fork":false,"pushed_at":"2019-03-31T11:54:45.000Z","size":47,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-10T12:56:17.335Z","etag":null,"topics":["functional","functional-programming","list-comprehension","more","tools"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jferard.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2019-02-01T20:38:56.000Z","updated_at":"2019-03-31T11:54:47.000Z","dependencies_parsed_at":"2024-08-20T11:38:50.023Z","dependency_job_id":null,"html_url":"https://github.com/jferard/yamft","commit_stats":null,"previous_names":["jferard/yamft"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jferard/yamft","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferard%2Fyamft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferard%2Fyamft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferard%2Fyamft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferard%2Fyamft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jferard","download_url":"https://codeload.github.com/jferard/yamft/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferard%2Fyamft/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278750243,"owners_count":26039304,"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-10-07T02:00:06.786Z","response_time":59,"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","functional-programming","list-comprehension","more","tools"],"created_at":"2025-01-17T12:56:39.565Z","updated_at":"2025-10-07T09:32:06.101Z","avatar_url":"https://github.com/jferard.png","language":"Python","readme":"|Build Status| |Code Coverage|\n\nYAMFT (Yet another `more-functools`)\n====================================\n\nCopyright (C) J. Férard 2019\n\nYAMFT is another functional library for Python.\n\nGoals\n-----\nYAMFT doesn't try to mimic Haskell, but rather tries to improve Python functional skills. It targets two main domains:\n\n* `list` and `dict` comprehensions: YAMFT aims to provide functions that will help write more powerful list and dict comprehensions.\n* `map`: YAMFT aims to provide helpers to write maps.\n\nBut the main goal of YAMFT is... fun. Python is not a functional language, but it's sometimes amusing to use functional idioms to express some lists.\n\n\nTricky list comprehensions\n~~~~~~~~~~~~~~~~~~~~~~~~~~\nList comprehension are very powerful, and sometimes we want them to be even more powerful. This\nleads to some weird constructions. YAMFT aims to provide helpers for writing those list comprehensions.\n\nFunctional paradigm in Python\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIt should be obvious for everyone that Python is not a pure functional language\nlike Haskell, and that the Python code is often more readable and efficient\nwhen we **do not** use the functional paradigm. Tough, I find that functional\nprogramming is sometimes beautiful.\n\n\nMethod\n------\nFunctional style in Python is often cumbersome:\n\n    \u003e\u003e\u003e map(lambda x:x*x*x, range(5))\n    [0, 1, 8, 27, 64]\n\nis worse than:\n\n    \u003e\u003e\u003e [x*x*x for x in range(5)]\n    [0, 1, 8, 27, 64]\n\n\nBut this is more disputable when you compare:\n\n    \u003e\u003e\u003e [str(x) for x in range(5)]\n    ['0', '1', '2', '3', '4']\n\nwith:\n\n    \u003e\u003e\u003e list(map(str, range(5)))\n    ['0', '1', '2', '3', '4']\n\nI prefer the latter. The main issue is the lambda syntax. Hence, YAMFT aims to provide plug and play curryfied functions to avoid lambdas.\n\n\nInstallation\n------------\n\nNeeds Python 3.7\n\nJust ``git clone`` the repo:\n\n.. code-block:: bash\n\n    \u003e git clone https://github.com/jferard/yamft.git\n\nTest\n----\n\n.. code-block:: bash\n\n    \u003e pytest --doctest-modules\n    \u003e pytest test/*\n\nHelp\n----\nFunctions are not first class citizens in Python. You can't give them a docstring when they are defined by an assignment (e.g. `fst = operator.itemgetter(0)`). YAMFT has a special `yamft_help` function to handle this case:\n\n    \u003e\u003e\u003e yamft_help(fst) # doctest:+ELLIPSIS\n    Help on fst:\n    ...\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjferard%2Fyamft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjferard%2Fyamft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjferard%2Fyamft/lists"}