title: Quick and resilient way to expose a python library API over the network as well as locally
body: <p>I'm looking for an easy and dependency-light way of wrapping a python library to expose it over:</p>
  <p>a) The network, either via HTTP or some other custom protocol, it doesn't matter that much, and encryption isn't required.
  b) The local machine, the main purpose here is to avoid library import overhead, ideally, this would happen via an efficient mechanism ala pipes or shared memory to minimize the number of data copies and [de]serialization.</p>
  <p>It seems like it's an easy enough job to just create a class that runs constantly, with e.g. an HTTP interface mirroring the library functionality and returning e.g. pickled objects corresponding to the answers. But getting it to work efficiently and cover various edge-cases seems tedious and I'm wondering if there's a better way to do this, ideally one that's built into python itself.</p>
  <p>Ray seems to have some functionality for this using Actors, but it seems rather heavy-weight and prone to fail when being installed, so I'm curios what alternatives exist.</p>
  <p>Also, might be too much of a &quot;library question&quot;, if you think it's better suited for another stack exchange website please tell me which and I'll remove it from here.</p>