Archer is a micro RPC framework inspired by Flask based on Thrift.
Save in a hello.py:
from archer import Archer
app = Archer('PingPong')
@app.api('ping')
def ping():
return 'pong'
Save in a hello.thrift:
service PingPong { string ping(), }
Archer would find the thrift file for you, and relying on Thriftpy to generate code on the fly.
And run it:
$ pip install Archer
$ archer run
* Running on 127.0.0.1:6000/
Archer would find the app instance to start a dev server, and reload it when detecting changes on your python or thrift file.
Just run the command:
$ archer call ping
* pong
Jump into shell with client at your hand:
$ archer client
>>> client.ping()
Pretty cool, eh!