一个用于完全使用Python开发客户端-服务器Web应用程序的模块,使用OWL本体进行语义数据持久化,并通过Ajax或WebSocket进行远程过程调用(RPC)。
项目描述
FullPy是一个用于开发客户端-服务器Web应用程序的高级Python模块。以下是主要功能:
客户端和服务器都使用Python编写,并且可以共享代码片段。FullPy使用Brython在Web浏览器中执行Python。
使用OWL本体进行语义感知数据持久化,而不是数据库。FullPy使用Owlready2管理本体,并将它们自动存储在SQLite3数据库中。
客户端和服务器之间的远程函数调用,具有对象序列化。FullPy可以使用Ajax(单向客户端->服务器调用)或WebSocket(客户端->服务器和服务器->客户端调用)。
FullPy还提供许多高级服务,例如身份验证、翻译支持、HTML小部件系统等。
FullPy可以在多个后端上运行:Flask、Werkzeug和Gunicorn(仅支持Gunicorn进行WebSocket)。
简例
以下是一个FullPy Web应用程序的示例
# Server import sys, os, os.path from fullpy.server import * class MyWebApp(ServerSideWebapp): def __init__(self): ServerSideWebapp.__init__(self) self.name = "demo" self.url = "/index.html" self.title = "FullPy demo" self.static_folder = os.path.join(os.path.dirname(__file__), "static") self.use_python_client(os.path.join(os.path.dirname(__file__), "client.py")) self.use_ajax(debug = True) @rpc # Mark the function as remotely callable by the client (RPC = remote procedure call) def server_hello(self, session): return "Hello world!" from fullpy.server.gunicorn_backend import * serve_forever([MyWebApp()], "http://127.0.0.1:5000")
# Client from fullpy.client import * class MyWebApp(ClientSideWebapp): def on_started(self): def done(response): html = HTML("""FullPy Demo loaded Ok! Server says: '%s'.""" % response) html.show() webapp.server_hello(done) # Call the server_hello() remote function on the server MyWebApp()
变更日志
版本 1 - 0.1
初始发布
链接
FullPy在BitBucket(Git开发仓库)上:https://bitbucket.org/jibalamy/fullpy
FullPy在PyPI(Python包索引,稳定版):https://pypi.python.org/pypi/FullPy
文档:http://fullpy.readthedocs.io/
联系“Jiba” Jean-Baptiste Lamy
<jean-baptiste.lamy *@* univ-paris13 *.* fr> LIMICS INSERM, Université Sorbonne Paris Nord, Sorbonne Université Bureau 149 74 rue Marcel Cachin 93017 BOBIGNY FRANCE
项目详情
关闭
fullpy-0.1.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 1d21c5e55f2c16ec5ae3d78f7b84372413164ecc3b1ee69fb1330d0064ace640 |
|
MD5 | 81cc33aa233ced84c50ab05ba378bb21 |
|
BLAKE2b-256 | 2ced5415dd6cf9e3856c5d1c2fcdeedd4842b620cac0e4d3e11f2fb185fad86c |