6

I'm looking for reactive state libraries like Mobx for Python, i.e. on server-side rather than client-side of a web application.

Mobx is similar to classic reactive libraries like RxPY, but has a different focus: It is not so much avout the low-level event dispatching, but reacting on data changes, recalculating derived values (but only those affected, and being lazy on non-observed dependent values). And Mobx determines dependencies of calculated values automatically.

Also, the Vue framework has such functionality built-in, with an even better syntax, with the upside (as well as downside) by being closely tied to the framework.

Alas, both are JavaScript and targeted at client-side / user interface.

So my specific questions are:

  • Are there similar reactive state libraries for Python?
  • Do these provide integration for storing/observing data in files?
    • (This would essentially be an inotify-based build system, but more fine-grained and more flexible.)
  • Do these provide integration with relational databases?
    • (Yes, there is a conceptual gap to be bridged, and it probably works only as long a single server instance accesses the database. It would still be very useful for wide range of applications.)
  • Do these provide integration with webserver frameworks?
    • (i.e. received HTTP requests trigger state changed and reclaculations, some calculated values are JSON structures which are observed by the client through web sockets, long polling or messaging systems.)
vog
  • 23,517
  • 11
  • 59
  • 75
  • May be this https://github.com/ReactiveX/RxPY is for you. – Richard Rublev Dec 14 '17 at 08:24
  • 1
    @RichardRublev I adjusted my question to make it more clear that classic reactive libraries such as RxPY are *not* what I'm looking for (unless they are more similar to Mobx state management than what can be seen from their documentation.) – vog Dec 14 '17 at 08:41

1 Answers1

8

I did one. It's called MoPyX. It's toolkit independent so you can just observe objects. But is geared towards UIs.

See: https://github.com/germaniumhq/mopyx

PySide2 demo: https://github.com/germaniumhq/mopyx-sample

bogdan.mustiata
  • 1,725
  • 17
  • 26