Are there reactive state libraries like Mobx for Python?
Asked Answered
J

1

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.)
Jorgensen answered 14/12, 2017 at 8:6 Comment(2)
May be this github.com/ReactiveX/RxPY is for you.Lucillalucille
@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.)Jorgensen
C
9

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

Cerf answered 1/11, 2018 at 21:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.