{"id":19860327,"url":"https://github.com/keepalive555/tornadoblueprint","last_synced_at":"2025-08-09T16:10:26.398Z","repository":{"id":57476627,"uuid":"102026951","full_name":"keepalive555/tornadoblueprint","owner":"keepalive555","description":"为Tornado框架开发的一款Flask风格的蓝图实现，实现了Flask Blueprint的一些常用功能。","archived":false,"fork":false,"pushed_at":"2023-08-14T21:46:12.000Z","size":34,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T22:11:26.512Z","etag":null,"topics":["blueprint","flask","flask-style","tornado"],"latest_commit_sha":null,"homepage":"https://blog.nice-ai-life.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keepalive555.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-31T17:31:59.000Z","updated_at":"2024-01-31T01:37:53.000Z","dependencies_parsed_at":"2022-09-12T14:32:44.275Z","dependency_job_id":null,"html_url":"https://github.com/keepalive555/tornadoblueprint","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keepalive555%2Ftornadoblueprint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keepalive555%2Ftornadoblueprint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keepalive555%2Ftornadoblueprint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keepalive555%2Ftornadoblueprint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keepalive555","download_url":"https://codeload.github.com/keepalive555/tornadoblueprint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251986607,"owners_count":21675950,"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":["blueprint","flask","flask-style","tornado"],"created_at":"2024-11-12T15:04:02.508Z","updated_at":"2025-05-02T04:30:20.135Z","avatar_url":"https://github.com/keepalive555.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TornadoBlueprint\n\n![build](https://travis-ci.org/keepalive555/tornadoblueprint.svg?branch=master)\n[![Coverage Status](https://coveralls.io/repos/github/keepalive555/tornadoblueprint/badge.svg?branch=master)](https://coveralls.io/github/keepalive555/tornadoblueprint?branch=master)\n\n## 前言\n\n非常感谢提交`PR`的朋友：[@lichao0x7cc](https://github.com/lichao0x7cc/)。\n\n## 概述\n\n笔者比较喜欢`Flask`框架`route`风格的`URL`路由，`Tornado`框架中`URL`路由是指定`tornado.web.Application`的参数，很不`Pythonic`，所以笔者为`Tornado`框架编写了`Flask`风格蓝图小玩具。\n\n现阶段支持的功能：\n\n- 支持`Blueprint`的`prefix`参数。\n- 支持`Blueprint.route`方法的`methods`参数，限定客户端`HTTP Methods`。\n- 支持`Blueprint.errorhandler`方法，指定蓝图的错误处理方法。\n- 支持`/\u003cint:id\u003e/, \u003cfloat:id\u003e, \u003cuuid:uuid\u003e`等`Flask`风格的`URI`，兼容`Tornado`正则表达式风格`URL`。\n- 支持`Flask`框架的`url_for`函数，使用`RequestHandler`的`__endpoint__`属性指定`endpoint`名称，未指定则默认为`__class__.__name__`。\n\n## 1. 安装\n\n***注意：*** `TornadoBlueprint`已上传至`Python`官方`PYPI`服务器，可通过`pip`命令直接安装，当前最新版本为`0.2.8`。\n\n```bash\npip install tornadoblueprint==0.2.8\n```\n\n## 2. 使用\n\n***注意：*** `TornadoBlueprint`示例代码如[demo.py](https://github.com/keepalive555/tornadoblueprint/blob/master/demo.py)所示。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeepalive555%2Ftornadoblueprint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeepalive555%2Ftornadoblueprint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeepalive555%2Ftornadoblueprint/lists"}