skip to navigation
skip to content

Not Logged In

Flask-JSONRPC 0.1

JSON-RPC implementation for Flask

Package Documentation

Latest Version: 0.3

A basic JSON-RPC implementation for your Flask-powered sites based on django-json-rpc.

Adding Flask JSON-RPC to your application

  1. Installation
$ pip install Flask-JSONRPC


$ git clone git://
$ cd flask-jsonrpc
$ python install
  1. Getting Started

Create your application and initialize the Flask-JSONRPC.

from flask import Flask
from flask_jsonrpc import JSONRPC

app = Flask(__name__)
jsonrpc = JSONRPC(app, '/api')

Write JSON-RPC methods.

def index():
    return 'Welcome to Flask JSON-RPC'

All code of Example

  1. Running
$ python
 * Running on
  1. Testing
$ curl -i -X POST -d '{"jsonrpc": "2.0", "method": "App.index", "params": {}, "id": "1"}' http://localhost:5000/api
HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 77
Server: Werkzeug/0.8.3 Python/2.7.3
Date: Fri, 14 Dec 2012 19:26:56 GMT

  "jsonrpc": "2.0",
  "id": "1",
  "result": "Welcome to Flask JSON-RPC"

Testing your service

>>> from flask_jsonrpc.proxy import ServiceProxy
>>> server = ServiceProxy('http://localhost:5000/api')
>>> server.App.index()
{'jsonrpc': '2.0', 'id': '91bce374-462f-11e2-af55-f0bf97588c3b', 'result': 'Welcome to Flask JSON-RPC'}


Project Information

Author:Cenobit Technologies, Inc.
Version:v0.0.1 of 2012/12/14
License:New BSD License
File Type Py Version Uploaded on Size
Flask-JSONRPC-0.1.tar.gz (md5) Source 2012-12-16 9KB
  • Downloads (All Versions):
  • 25 downloads in the last day
  • 192 downloads in the last week
  • 860 downloads in the last month