Giter Site home page Giter Site logo

awesome-functional-python's Introduction

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 ★4574 - "A functional standard library for Python".
  • more-itertools ★3591 - "More routines for operating on iterables, beyond itertools".
  • fn.py ★3347 - "Functional programming in Python: implementation of missing features to enjoy FP" (unmaintained since 2014). Maintained fork.
  • funcy ★3316 - "A fancy and practical functional tools".
  • PyFunctional ★2367 - "Python library for functional programming with collections in a data pipeline style".
  • Pipe ★1868 - "A Python library to use infix notation in Python".
  • Pydash ★1282 - "The kitchen sink of Python utility libraries for doing "stuff" in a functional way. Based on the Lo-Dash Javascript library".
  • hask ★857 - "Haskell language features and standard libraries in pure Python".
  • OSlash ★708 - "Functors, Applicatives, And Monads in Python".
  • Expression ★421 - "Pragmatic functional programming for Python inspired by F#". Successor of OSlash.
  • Effect ★368 - "Effect isolation in Python, to facilitate more purely functional code".
  • Underscore.py ★291 - "A Python port of excellent javascript library underscore.js".
  • fnc ★246 - "Functional programming in Python with generators and other utilities".
  • Flupy ★191 - 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 ★148 - "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 ★86 - "Supercharge your Python with parts of Lisp and Haskell."
  • ziopy ★74 - "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 ★28 - "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 ★3375 - "Make your functions return something meaningful, typed, and safe!"
  • result ★1427 - A simple Rust like Result type for Python 3. Fully type annotated.
  • Option ★81 - 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 ★1997 - "Persistent/Immutable/Functional data structures for Python".
  • Immutables ★1109 - "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 ★3509 - "Pampy: The Pattern Matching for Python you always dreamed of."
  • python-pattern-matching ★160 - "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 ★4714 - "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 ★1850 - "Python's nested data operator (and CLI), for all your declarative restructuring needs.".
  • python-lenses ★300 - "A python lens library for manipulating deeply nested immutable structures".

Other / specialized

  • deal ★712 - "Design by contract for Python with many validators support."
  • classes ★649 - "Smart, pythonic, ad-hoc, typed polymorphism for Python."
  • chainable ★191 - "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 ★4809 - "A dialect of Lisp that's embedded in Python".
  • Coconut ★4000 - "Simple, elegant, Pythonic functional programming".
  • Basilisp ★198 - "A Clojure-compatible(-ish) Lisp dialect targeting Python 3.8+".

Dead languages

  • pixie ★2343 - "A lightweight and native lisp built in RPython". (Discussion on HN)
  • Mochi ★914 - "A dynamically typed programming language for functional programming and actor-style programming.".
  • dg (aka dogelang) ★576 - "A programming language that compiles to CPython bytecode, much like Scala compiles to JVM's. That essentially means that dg is an alternative syntax for Python 3."
  • Pycket ★254 - "A rudimentary Racket implementation using RPython".
  • Tydy ★53 - "Tydy is a statically typed, functional-first programming language in the ML tradition. tydy is an implementation of Tydy as a Python library."
  • Arza ★5 - "Arza is a functional programming language that compiles to Python. It is a statically typed language with type inference and type classes."
  • (How to Write a (Lisp) Interpreter (in Python)) and (An ((Even Better) Lisp) Interpreter (in Python)) - a couple of famous articles by Peter Norvig.

More languages that compile to Python.

awesome-functional-python's People

Contributors

asapelkin avatar epost avatar gliptak avatar lexsong avatar mpkocher avatar orsinium avatar peey avatar phelps-sg avatar rajalokan avatar samuell avatar semiversus avatar sfermigier avatar sobolevn avatar thejaminator avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

awesome-functional-python's Issues

More link problems

I ran the site through https://validator.w3.org/checklink

error Line: 1971 http://www.oreilly.com/programming/free/files/functional-programming-python.pdf redirected to https://www.oreilly.com/programming/free/files/functional-programming-python.pdf
Status: 301 -> 404 Not Found
The link is broken. Double-check that you have not made any typo, or mistake in copy-pasting. If the link points to a resource that no longer exists, you may want to remove or fix the link.

error Line: 2007 https://www.udemy.com/functional-programming-in-7-days/
Status: 403 Forbidden
The link is forbidden! This needs fixing. Usual suspects: a missing index.html or Overview.html, or a missing ACL.

error Lines: 166, 1072, 1073, 1074, 1168, 1290, 1389, 1951, 1957, 1958, 1959, 1960, 1961, 1962, 1964, 1968, 1969, 1973, 1977, 1978, 1990, 1997, 2003, 2004, 2010, 2030, 2034, 2038, 2039, 2065, 2073, 2085, 2093, 2099, 2105, 2110, 2121, 2123, 2128, 2174 https://github.com/sfermigier/awesome-functional-python
Status: 200 OK
Some of the links to this resource point to broken URI fragments (such as index.html#fragment).

Broken fragments:
https://github.com/sfermigier/awesome-functional-python#free-books--ebooks (line 1969)
https://github.com/sfermigier/awesome-functional-python#dead-languages (line 2128)
https://github.com/sfermigier/awesome-functional-python#video-lectures-not-free (line 2004)
https://github.com/sfermigier/awesome-functional-python#non-free-books (line 1973)
https://github.com/sfermigier/awesome-functional-python#readme-ov-file (line 2174)
https://github.com/sfermigier/awesome-functional-python#books (lines 1958, 1968)
https://github.com/sfermigier/awesome-functional-python#active-languages (line 2123)
https://github.com/sfermigier/awesome-functional-python#scientific-papers (line 2030)
https://github.com/sfermigier/awesome-functional-python#advanced-or-specialized (line 1990)
https://github.com/sfermigier/awesome-functional-python#languages (lines 1962, 2121)
https://github.com/sfermigier/awesome-functional-python#general (line 2039)
https://github.com/sfermigier/awesome-functional-python#lenses-and-declarative-data-manipulations (line 2105)
https://github.com/sfermigier/awesome-functional-python#other-resources (lines 1960, 2003)
https://github.com/sfermigier/awesome-functional-python#immutable--persistent-data-structures (line 2073)
https://github.com/sfermigier/awesome-functional-python#tranducers (line 2093)
https://github.com/sfermigier/awesome-functional-python#pattern-matching (line 2085)
https://github.com/sfermigier/awesome-functional-python#blog-posts (line 2010)
https://github.com/sfermigier/awesome-functional-python#libraries (lines 1961, 2038)
https://github.com/sfermigier/awesome-functional-python#awesome-functional-python (line 1951)
https://github.com/sfermigier/awesome-functional-python#return-types (line 2065)
https://github.com/sfermigier/awesome-functional-python#presentation-slides (line 2034)
https://github.com/sfermigier/awesome-functional-python#official-documentation (lines 1957, 1964)
https://github.com/sfermigier/awesome-functional-python#data-science-oriented (line 1997)
https://github.com/sfermigier/awesome-functional-python#introductory (line 1978)
https://github.com/sfermigier/awesome-functional-python#talks (lines 1959, 1977)
https://github.com/sfermigier/awesome-functional-python#other--specialized (line 2110)
https://github.com/sfermigier/awesome-functional-python#support-for-reactive-style (line 2099)
info Line: 2001 https://docs.google.com/presentation/d/1eI60SL3UxtWfr9ktrv48-pcIkk4S7JiDmeXGCyyGhCs
Status: (N/A) Forbidden by robots.txt
The link was not checked due to robots exclusion rules. Check the link manually.

warning Line: 2016 https://medium.com/@hansonkd/thinking-functionally-with-python-and-django-4127e3ace6e9 redirected to https://hansonkd.medium.com/thinking-functionally-with-python-and-django-4127e3ace6e9
Status: 301 -> 200 OK
This is a permanent redirect. The link should be updated to point to the more recent URI.

Broken fragments:
https://medium.com/@hansonkd/thinking-functionally-with-python-and-django-4127e3ace6e9#.own6sie8s (line 2016)
error Line: 2130 https://news.ycombinator.com/item?id=13420092
Status: 405 Not Allowed
The server does not allow HTTP HEAD requests, which prevents the Link Checker to check the link automatically. Check the link manually.

error Line: 2028 https://www.leftfile.org/
Status: 503 Service Unavailable
The server cannot service the request, for some unknown reason.

List of redirects
The links below are not broken, but the document does not use the exact URL, and the links were redirected. It may be a good idea to link to the final location, for the sake of speed.

warning Line: 1975 https://www.packtpub.com/application-development/functional-python-programming redirected to https://www.packtpub.com/product/functional-python-programming-second-edition/9781788627061
Status: 301 -> 200 OK
This is a permanent redirect. The link should be updated.

warning Line: 2113 https://github.com/olirice/chainable redirected to https://github.com/olirice/flupy
Status: 301 -> 200 OK
This is a permanent redirect. The link should be updated.

warning Line: 2032 http://www.cs.jhu.edu/~roe/padl2014.pdf redirected to https://www.cs.jhu.edu/~roe/padl2014.pdf
Status: 301 -> 200 OK
This is a permanent redirect. The link should be updated.

warning Line: 2134 https://github.com/cyrus-/tydy redirected to https://github.com/cyrus-/typy
Status: 301 -> 200 OK
This is a permanent redirect. The link should be updated.

warning Line: 1995 http://www.slideshare.net/alinadolgikh/austin-bingham-transducers-in-python redirected to https://www.slideshare.net/alinadolgikh/austin-bingham-transducers-in-python
Status: 301 -> 200 OK
This is a permanent redirect. The link should be updated.

warning Line: 2050 https://github.com/cognitedata/Expression redirected to https://github.com/dbrattli/Expression
Status: 301 -> 200 OK
This is a permanent redirect. The link should be updated.

warning Line: 2042 https://github.com/erikrose/more-itertools redirected to https://github.com/more-itertools/more-itertools
Status: 301 -> 200 OK
This is a permanent redirect. The link should be updated.

warning Line: 2063 https://github.com/MartinBernstorff/Iter redirected to https://github.com/MartinBernstorff/iterpy
Status: 301 -> 200 OK
This is a permanent redirect. The link should be updated.

warning Line: 2006 http://shop.oreilly.com/product/0636920042778.do redirected to https://www.oreilly.com/library/view/functional-programming-with/9781771374651/
Status: 301 -> 200 OK
This is a permanent redirect. The link should be updated.

warning Line: 2068 https://github.com/dbrgn/result redirected to https://github.com/rustedpy/result
Status: 301 -> 200 OK
This is a permanent redirect. The link should be updated.

warning Line: 1994 http://slides.com/tobiasgustafsson/immutability-and-python redirected to https://slides.com:443/tobiasgustafsson/immutability-and-python
Status: 301 -> 200 OK
This is a permanent redirect. The link should be updated.

warning Line: 2112 https://github.com/orsinium/deal redirected to https://github.com/life4/deal
Status: 301 -> 200 OK
This is a permanent redirect. The link should be updated.

Include unpythonic: Lisp/Haskell features for Python?

Recently, I've been cooking up a library called unpythonic that adds Lisp and Haskell inspired features into Python.

There's a core of functionally oriented stuff that runs on bare Python, plus unpythonic.syntax, a collection of language features implemented in MacroPy3, including let/let*/letrec constructs, automatic TCO, automatic currying, lazy functions (call-by-need), and continuations (call/cc).

It's on PyPI.

What do you think, is it on topic?

RxPY

Hi - many thanks for this extensive list, found a few really interesting libs!

One thing: ReactiveX is pretty spread meanwhile in the industry. I know, its considered slightly different to functional programming but still.
And the RxPY implementation is really serious, absolutely feature complete, we use it in production - and it offers more than the JS or Java implementation - but still, due to a private effort of one guy (not me) dependent on some marketing, so:

I think RxPY should get its stars mentioned - since I think it is well within the top 5 most popular libs on your list & and it really deserves it - there are some books around that specific Rx implementation :-)

Adding new library - orinoco

Hi guys, firstly thanks for this project, I’ve found many interesting projects here. I’m not sure what’s the correct procedure, but I would like to ask you to consider adding a library I developed - Orinoco. If you have any feedback I’d love to hear it as well. Thanks

Most libraries are inactive

While looking at some of the libraries, I noticed that many of them haven't been active for years, and some archived.

I checked all of them. I listed the ones with >1 year since the last PyPi release, and no commit activity, and the year since the last (non-trivial) commit:

General

14 / 23

Return types

2 / 5

Immutable / persistent data structures

4 / 6

Pattern matching

3 / 4

Transducers

2 / 2 (!)

Reactive programming

2 / 3

  • RxPy - 2022 (no reactions on issues either)
  • sodium-python - 2022 (except for 2 commits and minimal release in July, 2023)

Lenses and declarative data manipulations

0 / 2

Other / specialized

4 / 87

Languages

5/8


Removing these would not be a good idea IMHO -- clearly marking them as inactive, unmaintained, or abandoned would be more informative.

It's truly sad to see so many of these (potentially) awesome projects end like this...

Include Pampy?

One of the most useful things in functional programming I've come across is pattern matching, and Pampy seems to do a good job of it.

https://github.com/santinic/pampy

Consider adding this? I'm in a time crunch or I'd make a PR, but I just wanted to get this mentioned somewhere.

Add information on type-safety

I personally use it as a filter (love me some type-safety). I can volunteer gathering the information as well 👍

For categories, I'd propose something like (full/partial/no), and only evaluate a sample of public methods.

What do you think? :-)

Result?

I came across this Result - Rust like return types.
This is very smaller in scope compared to Returns but quite nice.
Belongs here?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.