{"id":13421671,"url":"https://github.com/cenobites/flask-jsonrpc","last_synced_at":"2025-05-15T03:05:54.629Z","repository":{"id":5949061,"uuid":"7169945","full_name":"cenobites/flask-jsonrpc","owner":"cenobites","description":"Basic JSON-RPC implementation for your Flask-powered sites","archived":false,"fork":false,"pushed_at":"2025-02-01T07:56:55.000Z","size":2037,"stargazers_count":290,"open_issues_count":14,"forks_count":62,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-21T03:56:00.995Z","etag":null,"topics":["flask","flask-extensions","jsonrpc","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cenobites.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"nycholas"}},"created_at":"2012-12-14T18:33:24.000Z","updated_at":"2025-04-01T10:51:17.000Z","dependencies_parsed_at":"2023-02-10T20:55:13.298Z","dependency_job_id":"d12c0a89-9177-4037-bf1e-45891a4c6173","html_url":"https://github.com/cenobites/flask-jsonrpc","commit_stats":{"total_commits":455,"total_committers":18,"mean_commits":25.27777777777778,"dds":0.4747252747252747,"last_synced_commit":"a4031daaaf54b67f002b62de162a904f3f34cee4"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cenobites%2Fflask-jsonrpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cenobites%2Fflask-jsonrpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cenobites%2Fflask-jsonrpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cenobites%2Fflask-jsonrpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cenobites","download_url":"https://codeload.github.com/cenobites/flask-jsonrpc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254264765,"owners_count":22041793,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","flask-extensions","jsonrpc","python"],"created_at":"2024-07-30T23:00:27.999Z","updated_at":"2025-05-15T03:05:54.611Z","avatar_url":"https://github.com/cenobites.png","language":"Python","funding_links":["https://github.com/sponsors/nycholas"],"categories":["Flask Utilities","Python","Utils","Uncategorized","介绍"],"sub_categories":["Uncategorized"],"readme":"![Release Status](https://github.com/cenobites/flask-jsonrpc/actions/workflows/release.yml/badge.svg)\n![Tests Status](https://github.com/cenobites/flask-jsonrpc/actions/workflows/tests.yml/badge.svg?branch=master)\n[![Coverage Status](https://coveralls.io/repos/github/cenobites/flask-jsonrpc/badge.svg?branch=master)](https://coveralls.io/github/cenobites/flask-jsonrpc?branch=master)\n[![Documentation Status](https://readthedocs.org/projects/flask-jsonrpc/badge/?version=latest)](https://flask-jsonrpc.readthedocs.io/en/latest/?badge=latest)\n# Flask JSON-RPC\n\nBasic JSON-RPC implementation for your Flask-powered sites.\n\nSome reasons you might want to use:\n\n* Simple, powerful, flexible, and pythonic API.\n* Support [JSON-RPC 2.0](https://www.jsonrpc.org/specification \"JSON-RPC 2.0\") version.\n* Support Python 3.9 or later.\n* Experimental support to [Mypyc](https://mypyc.readthedocs.io/en/latest/introduction.html), it compiles Python modules to C extensions.\n* The web browsable API.\n* Run-time type checking functions defined with [PEP 484](https://www.python.org/dev/peps/pep-0484/ \"PEP 484\") argument (and return) type annotations.\n* Extensive documentation, and great community support.\n\nThere is a live example API for testing purposes, [available here](https://flask-jsonrpc.cenobit.es/api/browse/#/ \"Web browsable API\").\n\n**Below:** *Screenshot from the browsable API*\n\n![Web browsable API](https://f.cloud.github.com/assets/298350/1575590/203c595a-5150-11e3-99a0-4a6fd9bcbe52.png \"Web browsable API\")\n\n### Adding Flask JSON-RPC to your application\n\n1. Installation\n\n```console\n$ pip install Flask-JSONRPC\n```\n\nor\n\n```console\n$ git clone git://github.com/cenobites/flask-jsonrpc.git\n$ cd flask-jsonrpc\n$ python setup.py install\n```\n\n\n2. Getting Started\n\nCreate your application and initialize the Flask-JSONRPC.\n\n```python\nfrom flask import Flask\nfrom flask_jsonrpc import JSONRPC\n\napp = Flask(\"application\")\njsonrpc = JSONRPC(app, \"/api\", enable_web_browsable_api=True)\n```\n\nWrite JSON-RPC methods.\n\n```python\n@jsonrpc.method(\"App.index\")\ndef index() -\u003e str:\n    return \"Welcome to Flask JSON-RPC\"\n```\n\nAll code of example [run.py](https://github.com/cenobites/flask-jsonrpc/blob/master/run.py).\n\n\n3. Running\n\n```console\n$ python run.py\n * Running on http://0.0.0.0:5000/\n```\n\n4. Testing\n\n```console\n$ curl -i -X POST \\\n   -H \"Content-Type: application/json; indent=4\" \\\n   -d '{\n    \"jsonrpc\": \"2.0\",\n    \"method\": \"App.index\",\n    \"params\": {},\n    \"id\": \"1\"\n}' http://localhost:5000/api\n\nHTTP/1.0 200 OK\nContent-Type: application/json\nContent-Length: 77\nServer: Werkzeug/0.8.3 Python/2.7.3\nDate: Fri, 14 Dec 2012 19:26:56 GMT\n\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": \"1\",\n  \"result\": \"Welcome to Flask JSON-RPC\"\n}\n```\n\n\n### References\n\n* [http://docs.python.org/](http://docs.python.org/)\n* [https://flask.palletsprojects.com/](https://flask.palletsprojects.com/)\n* [http://www.jsonrpc.org/](http://www.jsonrpc.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcenobites%2Fflask-jsonrpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcenobites%2Fflask-jsonrpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcenobites%2Fflask-jsonrpc/lists"}