Project Icon

awesome-functional-python

Python函数式编程精选资源大全

本列表汇集了Python函数式编程的优质资源,包含官方文档、书籍、演讲和各类工具库。涵盖从入门到进阶的全面内容,助力开发者掌握函数式编程范式。收录了不可变数据结构、模式匹配、响应式编程等多个领域的实用工具,以及专为Python函数式编程设计的库。另外还介绍了Python生态系统中的相关函数式编程语言,为开发者提供全方位的学习参考。

Awesome Functional Python

A curated list of awesome things related to functional programming in Python.

Awesome

Official documentation

  • Functional Programming HOWTO - "In this document, we’ll take a tour of Python’s features suitable for implementing programs in a functional style".

Books

Free books / ebooks

Non-free books

Talks

Introductory

  • Functional Programming with Python (slides) - Alexey Kachayev, UA PYCon 2012.
  • Purely Functional Programming in Python: Pure Fun (slides) - Christopher Armstrong, PyTenessee 2015.
  • Side Effects are a Public API (video) - Christopher Armstrong, Strangeloop 2015
  • Functional Programming with Python (video) - Mike Müller, PyCon US 2013.
  • Using Functional Programming for efficient Data Processing and Analysis (video) - Reuben Cummings, PyCon US 2017.
  • Immutable Programming Writing Functional Python (slides, video), Calen Pennington, PyCon 2017.
  • Functional Programming inside OOP? It’s possible with Python (Slides) - Carlos Villavicencio, EuroPython 2021.
  • A Hitchhiker’s Guide to functools (Slides) - Scott Irwin, EuroPython 2021.
  • Writing Functional Code in Python (Video) - Vic Kumar, PyCon 2022

Advanced or specialized

  • Functionalish programming in Python with effect (video), Robert Collins, NZ PyCon 2015.
  • Monadic Parsing in Python (slides), Alexey Kachayev, KyivPy 2014.
  • Immutability and Python - Introducing Pyrsistent (slides), Tobias Gustafsson, 2014.
  • Understanding Transducers (slides, video), Austin Bingham, PyCon Belarus 2015.

Data science oriented

  • Functional Performance with Core Data Structures (video), Matthew Rocklin, PyData SV 2014.
  • Old School - Functional Data Analysis (video), Matthew Rocklin, PyData NYC 2013.
  • Learning Data Science Using Functional Python (video, slides), Joel Grus, PyData Seattle 2015.

Other resources

Video lectures (not free)

Blog posts

Scientific papers

Presentation slides

Libraries

General

  • toolz ★4619 - "A functional standard library for Python".
  • more-itertools ★3639 - "More routines for operating on iterables, beyond itertools".
  • fn.py ★3348 - "Functional programming in Python: implementation of missing features to enjoy FP" (unmaintained since 2014). Maintained fork.
  • funcy ★3333 - "A fancy and practical functional tools".
  • PyFunctional ★2380 - "Python library for functional programming with collections in a data pipeline style".
  • Pipe ★1898 - "A Python library to use infix notation in Python".
  • Pydash ★1291 - "The kitchen sink of Python utility libraries for doing "stuff" in a functional way. Based on the Lo-Dash Javascript library".
  • hask ★858 - "Haskell language features and standard libraries in pure Python".
  • OSlash ★709 - "Functors, Applicatives, And Monads in Python".
  • Expression ★454 - "Pragmatic functional programming for Python inspired by F#". Successor of OSlash.
  • Effect ★369 - "Effect isolation in Python, to facilitate more purely functional code".
  • Underscore.py ★291 - "A Python port of excellent javascript library underscore.js".
  • fnc ★247 - "Functional programming in Python with generators and other utilities".
  • Flupy ★192 - Implements a fluent interface for operating on python iterables.
  • PyMonad ★189 - "a small library implementing monads and related data abstractions -- functors, applicative functors, and monoids -- for use in implementing functional style programs".
  • pfun ★149 - "Pure functional programming in python".
  • Phi ★132 - "A library that intends to remove as much of the pain as possible from your functional programming experience in Python."
  • pyramda ★127 - "Python package supporting heavy functional programming through currying. Translation of the Ramda library from javascript to python".
  • unpythonic ★87 - "Supercharge your Python with parts of Lisp and Haskell."
  • ziopy ★75 - "ZIO for Python (with ZIO = A type-safe, composable library for async and concurrent programming in Scala)"
  • pyMonet ★34 - "High abstract python library for functional programming. Contains algebraic data structures known from Haskell or Scala".
  • Compose ★32 - The classic compose, with all the Pythonic features.
  • pyeffects ★30 - "Handle side-effects in Python like a boss. Implements functional types for Either, Option, Try, and Future."
  • Iter ★10 - map, filter etc. as methods on a sequence.

Return types

  • returns ★3421 - "Make your functions return something meaningful, typed, and safe!"
  • result ★1458 - A simple Rust like Result type for Python 3. Fully type annotated.
  • Option ★84 - Rust-like Option and Result types in Python.
  • Meiga ★76 - A simple, typed and monad-based Result type for Python.
  • Safetywrap ★43 - Fully typesafe, Rust-like Result and Option types for Python.

Immutable / persistent data structures

  • Pyrsistent ★2005 - "Persistent/Immutable/Functional data structures for Python".
  • Immutables ★1116 - "An immutable mapping type for Python."

Dead projects:

  • Discodb ★98 - "An efficient, immutable, persistent mapping object".
  • Funktown ★74 - "Immutable Data Structures for Python".
  • Amino ★35 - "functional data structures and type classes".
  • Pysistence - "Pysistence is a project that seeks to make functional programming in python easier".

Pattern matching

Note: Pattern matching is now a standard feature in Python 3.10.

  • pampy ★3511 - "Pampy: The Pattern Matching for Python you always dreamed of."
  • python-pattern-matching ★161 - "Python pattern matching like functional languages."
  • patmat ★30 - "Functional-style recursive pattern matching in Python. Crazy stuff."
  • apm ★107 - "Pattern Matching for Python 3.8+ in a simple, yet powerful, extensible manner."

Tranducers

(Both projects are dead).

  • Tranducers-Python ★202 - "Transducers are composable algorithmic transformations".
  • Transducers ★55 - "This is a port of the transducer concept from Clojure to Python, with an emphasis on providing as Pythonic as interpretation of transducers as possible, rather than reproducing Clojurisms more literally".

Support for reactive style

  • RxPy ★4727 - "Reactive Extensions for Python".
  • broqer ★74 - "Library to operate with continuous streams of data in a reactive style"
  • sodium-python ★3 - "Python implementation of Sodium - Functional Reactive Programming (FRP) Library"

Lenses and declarative data manipulations

  • Glom ★1868 - "Python's nested data operator (and CLI), for all your declarative restructuring needs.".
  • python-lenses ★304 - "A python lens library for manipulating deeply nested immutable structures".

Other / specialized

  • deal ★719 - "Design by contract for Python with many validators support."
  • classes ★651 - "Smart, pythonic, ad-hoc, typed polymorphism for Python."
  • chainable ★192 - "Method chaining built on generators".
  • ADT ★172 - Algebraic data types for Python
  • sumtypes ★42 - "Sum Types, aka Tagged Unions, for Python".
  • python-mini-lambda ★13 - "Simple Lambda functions without lambda x: and with string conversion capability"
  • Orinoco ★11 - "Functional composable pipelines allowing clean separation of the business logic and its implementation"
  • slist ★11 - "A drop-in replacement for the python mutable list. But with much more methods for typesafe method chaining."
  • py-frm ★1 - "Proof-of-concept Functional-Relational Mapping (FRM) for Python"

Languages

Functional programming languages that are not Python but are related to the Python ecosystem:

Active languages

  • Hy ★4822 -
项目侧边栏1项目侧边栏2
推荐项目
Project Cover

豆包MarsCode

豆包 MarsCode 是一款革命性的编程助手,通过AI技术提供代码补全、单测生成、代码解释和智能问答等功能,支持100+编程语言,与主流编辑器无缝集成,显著提升开发效率和代码质量。

Project Cover

AI写歌

Suno AI是一个革命性的AI音乐创作平台,能在短短30秒内帮助用户创作出一首完整的歌曲。无论是寻找创作灵感还是需要快速制作音乐,Suno AI都是音乐爱好者和专业人士的理想选择。

Project Cover

白日梦AI

白日梦AI提供专注于AI视频生成的多样化功能,包括文生视频、动态画面和形象生成等,帮助用户快速上手,创造专业级内容。

Project Cover

有言AI

有言平台提供一站式AIGC视频创作解决方案,通过智能技术简化视频制作流程。无论是企业宣传还是个人分享,有言都能帮助用户快速、轻松地制作出专业级别的视频内容。

Project Cover

Kimi

Kimi AI助手提供多语言对话支持,能够阅读和理解用户上传的文件内容,解析网页信息,并结合搜索结果为用户提供详尽的答案。无论是日常咨询还是专业问题,Kimi都能以友好、专业的方式提供帮助。

Project Cover

讯飞绘镜

讯飞绘镜是一个支持从创意到完整视频创作的智能平台,用户可以快速生成视频素材并创作独特的音乐视频和故事。平台提供多样化的主题和精选作品,帮助用户探索创意灵感。

Project Cover

讯飞文书

讯飞文书依托讯飞星火大模型,为文书写作者提供从素材筹备到稿件撰写及审稿的全程支持。通过录音智记和以稿写稿等功能,满足事务性工作的高频需求,帮助撰稿人节省精力,提高效率,优化工作与生活。

Project Cover

阿里绘蛙

绘蛙是阿里巴巴集团推出的革命性AI电商营销平台。利用尖端人工智能技术,为商家提供一键生成商品图和营销文案的服务,显著提升内容创作效率和营销效果。适用于淘宝、天猫等电商平台,让商品第一时间被种草。

Project Cover

AIWritePaper论文写作

AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。

投诉举报邮箱: service@vectorlightyear.com
@2024 懂AI·鲁ICP备2024100362号-6·鲁公网安备37021002001498号