Skip to content

Overview

Python Hooks, a React inspired way to code in Python.

drawing

  • ⚡ïļ Written with performance in mind (Not using inspect module)
  • 🐍 Support for familiar React like hooks such as use_state, use_effect, use_reducer, use_context and more.
  • 🛠ïļ Built with plugins support and easy to extend.
  • ðŸĪ Python 3.9+ compatibility
  • ðŸŠķ Lightweight to remove the need for a lot of boilerplate code.
  • ðŸ“Ķ Support for different backend state-stores.
  • 🔧 Support for hooks-state scoping.
  • 🌎 Redis and Zustand plugins out of the box.
  • 🔌 Tested mainly on CPython.

API Example

As Python is commonly used to create APIs, I wanted to provide one real-world example of using hooks for state management in Flask. Note, that this is just one example and the library can be used in many other ways. See examples for more examples.

drawing

See Getting started for a quick tutorial on how to use the library.

See Inspiration for a more in-depth explanation of the motivation behind this project.


Made with love by Amit Assaraf