diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-05-05 12:24:25 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-05-05 12:24:25 +0000 |
| commit | 6cadb80544afa2c1342bcf5655c1011c6682f78e (patch) | |
| tree | 9c9252ab4e280f6d6e346ea5f8ae6feff3c76c9a | |
| parent | 2dfc8ad90b70d782382476c1ff8196f4a3496c9b (diff) | |
automatic import of python-flask-jsonrpcopeneuler20.03
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-flask-jsonrpc.spec | 380 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 382 insertions, 0 deletions
@@ -0,0 +1 @@ +/Flask-JSONRPC-2.2.2.tar.gz diff --git a/python-flask-jsonrpc.spec b/python-flask-jsonrpc.spec new file mode 100644 index 0000000..52b492c --- /dev/null +++ b/python-flask-jsonrpc.spec @@ -0,0 +1,380 @@ +%global _empty_manifest_terminate_build 0 +Name: python-Flask-JSONRPC +Version: 2.2.2 +Release: 1 +Summary: Adds JSONRPC support to Flask. +License: BSD-3-Clause +URL: https://github.com/cenobites/flask-jsonrpc +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/a5/7b/8cbd53084a1efb58a1105905a38b0cbefcd3ae13ef2c90c07eedf0fdb6dc/Flask-JSONRPC-2.2.2.tar.gz +BuildArch: noarch + +Requires: python3-Flask +Requires: python3-typeguard +Requires: python3-typing-inspect +Requires: python3-typing +Requires: python3-typing-extensions +Requires: python3-typing-extensions +Requires: python3-Flask[async] +Requires: python3-Flask[dotenv] + +%description +[](https://travis-ci.org/cenobites/flask-jsonrpc) +[](https://coveralls.io/github/cenobites/flask-jsonrpc?branch=master) +[](https://flask-jsonrpc.readthedocs.io/en/latest/?badge=latest) +# Flask JSON-RPC + +Basic JSON-RPC implementation for your Flask-powered sites. + +Some reasons you might want to use: + +* Simple, powerful, flexible, and pythonic API. +* Support [JSON-RPC 2.0](https://www.jsonrpc.org/specification "JSON-RPC 2.0") version. +* Support python 3.6 or later. +* The web browsable API. +* Run-time type checking functions defined with [PEP 484](https://www.python.org/dev/peps/pep-0484/ "PEP 484") argument (and return) type annotations. +* Extensive documentation, and great community support. + +There is a live example API for testing purposes, [available here](http://flask-jsonrpc.herokuapp.com/api/browse "Web browsable API"). + +**Below:** *Screenshot from the browsable API* + + + +### Adding Flask JSON-RPC to your application + +1. Installation + +```console +$ pip install Flask-JSONRPC +``` + +or + +```console +$ git clone git://github.com/cenobites/flask-jsonrpc.git +$ cd flask-jsonrpc +$ python setup.py install +``` + + +2. Getting Started + +Create your application and initialize the Flask-JSONRPC. + +```python +from flask import Flask +from flask_jsonrpc import JSONRPC + +app = Flask("application") +jsonrpc = JSONRPC(app, "/api", enable_web_browsable_api=True) +``` + +Write JSON-RPC methods. + +```python +@jsonrpc.method("App.index") +def index() -> str: + return "Welcome to Flask JSON-RPC" +``` + +All code of example [run.py](https://github.com/cenobites/flask-jsonrpc/blob/master/run.py). + + +3. Running + +```console +$ python run.py + * Running on http://0.0.0.0:5000/ +``` + +4. Testing + +```console +$ curl -i -X POST \ + -H "Content-Type: application/json; indent=4" \ + -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" +} +``` + + +### References + +* [http://docs.python.org/](http://docs.python.org/) +* [https://flask.palletsprojects.com/](https://flask.palletsprojects.com/) +* [http://www.jsonrpc.org/](http://www.jsonrpc.org/) + + +%package -n python3-Flask-JSONRPC +Summary: Adds JSONRPC support to Flask. +Provides: python-Flask-JSONRPC +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-Flask-JSONRPC +[](https://travis-ci.org/cenobites/flask-jsonrpc) +[](https://coveralls.io/github/cenobites/flask-jsonrpc?branch=master) +[](https://flask-jsonrpc.readthedocs.io/en/latest/?badge=latest) +# Flask JSON-RPC + +Basic JSON-RPC implementation for your Flask-powered sites. + +Some reasons you might want to use: + +* Simple, powerful, flexible, and pythonic API. +* Support [JSON-RPC 2.0](https://www.jsonrpc.org/specification "JSON-RPC 2.0") version. +* Support python 3.6 or later. +* The web browsable API. +* Run-time type checking functions defined with [PEP 484](https://www.python.org/dev/peps/pep-0484/ "PEP 484") argument (and return) type annotations. +* Extensive documentation, and great community support. + +There is a live example API for testing purposes, [available here](http://flask-jsonrpc.herokuapp.com/api/browse "Web browsable API"). + +**Below:** *Screenshot from the browsable API* + + + +### Adding Flask JSON-RPC to your application + +1. Installation + +```console +$ pip install Flask-JSONRPC +``` + +or + +```console +$ git clone git://github.com/cenobites/flask-jsonrpc.git +$ cd flask-jsonrpc +$ python setup.py install +``` + + +2. Getting Started + +Create your application and initialize the Flask-JSONRPC. + +```python +from flask import Flask +from flask_jsonrpc import JSONRPC + +app = Flask("application") +jsonrpc = JSONRPC(app, "/api", enable_web_browsable_api=True) +``` + +Write JSON-RPC methods. + +```python +@jsonrpc.method("App.index") +def index() -> str: + return "Welcome to Flask JSON-RPC" +``` + +All code of example [run.py](https://github.com/cenobites/flask-jsonrpc/blob/master/run.py). + + +3. Running + +```console +$ python run.py + * Running on http://0.0.0.0:5000/ +``` + +4. Testing + +```console +$ curl -i -X POST \ + -H "Content-Type: application/json; indent=4" \ + -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" +} +``` + + +### References + +* [http://docs.python.org/](http://docs.python.org/) +* [https://flask.palletsprojects.com/](https://flask.palletsprojects.com/) +* [http://www.jsonrpc.org/](http://www.jsonrpc.org/) + + +%package help +Summary: Development documents and examples for Flask-JSONRPC +Provides: python3-Flask-JSONRPC-doc +%description help +[](https://travis-ci.org/cenobites/flask-jsonrpc) +[](https://coveralls.io/github/cenobites/flask-jsonrpc?branch=master) +[](https://flask-jsonrpc.readthedocs.io/en/latest/?badge=latest) +# Flask JSON-RPC + +Basic JSON-RPC implementation for your Flask-powered sites. + +Some reasons you might want to use: + +* Simple, powerful, flexible, and pythonic API. +* Support [JSON-RPC 2.0](https://www.jsonrpc.org/specification "JSON-RPC 2.0") version. +* Support python 3.6 or later. +* The web browsable API. +* Run-time type checking functions defined with [PEP 484](https://www.python.org/dev/peps/pep-0484/ "PEP 484") argument (and return) type annotations. +* Extensive documentation, and great community support. + +There is a live example API for testing purposes, [available here](http://flask-jsonrpc.herokuapp.com/api/browse "Web browsable API"). + +**Below:** *Screenshot from the browsable API* + + + +### Adding Flask JSON-RPC to your application + +1. Installation + +```console +$ pip install Flask-JSONRPC +``` + +or + +```console +$ git clone git://github.com/cenobites/flask-jsonrpc.git +$ cd flask-jsonrpc +$ python setup.py install +``` + + +2. Getting Started + +Create your application and initialize the Flask-JSONRPC. + +```python +from flask import Flask +from flask_jsonrpc import JSONRPC + +app = Flask("application") +jsonrpc = JSONRPC(app, "/api", enable_web_browsable_api=True) +``` + +Write JSON-RPC methods. + +```python +@jsonrpc.method("App.index") +def index() -> str: + return "Welcome to Flask JSON-RPC" +``` + +All code of example [run.py](https://github.com/cenobites/flask-jsonrpc/blob/master/run.py). + + +3. Running + +```console +$ python run.py + * Running on http://0.0.0.0:5000/ +``` + +4. Testing + +```console +$ curl -i -X POST \ + -H "Content-Type: application/json; indent=4" \ + -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" +} +``` + + +### References + +* [http://docs.python.org/](http://docs.python.org/) +* [https://flask.palletsprojects.com/](https://flask.palletsprojects.com/) +* [http://www.jsonrpc.org/](http://www.jsonrpc.org/) + + +%prep +%autosetup -n Flask-JSONRPC-2.2.2 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-Flask-JSONRPC -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Fri May 05 2023 Python_Bot <Python_Bot@openeuler.org> - 2.2.2-1 +- Package Spec generated @@ -0,0 +1 @@ +fb6205e6e776802c6000ea7119229066 Flask-JSONRPC-2.2.2.tar.gz |
