All Projects → dianbaer → Jupiter

dianbaer / Jupiter

Licence: mit
jupiter是一个aio web框架,基于aiohttp。支持(restful格式、扫描注解、依赖注入、jinja2模板引擎、ORM框架)等。

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Jupiter

Butterfly
🔥 蝴蝶--【简单】【稳定】【好用】的 Python web 框架🦋 除 Python 2.7,无其他依赖; 🦋 butterfly 是一个 RPC 风格 web 框架,同时也是微服务框架,自带消息队列通信机制实现分布式
Stars: ✭ 82 (-41.43%)
Mutual labels:  orm, web-framework, template
Cphalcon7
Dao7 - Web framework for PHP7.x,项目接洽 QQ 176013762
Stars: ✭ 237 (+69.29%)
Mutual labels:  orm, web-framework
Framework
ThinkPHP Framework
Stars: ✭ 2,399 (+1613.57%)
Mutual labels:  orm, template
Phpboot
☕️ 🚀 tiny & fast PHP framework for building Microservices/RESTful APIs, with useful features: IOC, Hook, ORM, RPC, Swagger, Annotation, Parameters binding, Validation, etc.
Stars: ✭ 638 (+355.71%)
Mutual labels:  orm, annotation
Orm Lite
Header-Only, Strong-Typed, Compile-time Object Relation Mapping (ORM) in Modern C++ :-)
Stars: ✭ 164 (+17.14%)
Mutual labels:  orm, template
Flango
A Django template for using Flask for the frontend, Django for the backend.
Stars: ✭ 188 (+34.29%)
Mutual labels:  orm, template
Gf
GoFrame is a modular, powerful, high-performance and enterprise-class application development framework of Golang.
Stars: ✭ 6,501 (+4543.57%)
Mutual labels:  orm, template
Thinkgo
A lightweight MVC framework written in Go (Golang).
Stars: ✭ 184 (+31.43%)
Mutual labels:  orm, web-framework
Heroku Aiohttp Web
A project starter template for deploying an aiohttp app to Heroku
Stars: ✭ 14 (-90%)
Mutual labels:  aiohttp, template
Think
ThinkPHP Framework ——十年匠心的高性能PHP框架
Stars: ✭ 7,681 (+5386.43%)
Mutual labels:  orm, template
Cakephp
CakePHP: The Rapid Development Framework for PHP - Official Repository
Stars: ✭ 8,453 (+5937.86%)
Mutual labels:  orm, web-framework
Hunt Framework
A Web framework for D Programming Language. Full-stack high-performance.
Stars: ✭ 256 (+82.86%)
Mutual labels:  orm, web-framework
Skinny Framework
🚝 "Scala on Rails" - A full-stack web app framework for rapid development in Scala
Stars: ✭ 719 (+413.57%)
Mutual labels:  orm, web-framework
Foal
Elegant and all-inclusive Node.Js web framework based on TypeScript. 🚀.
Stars: ✭ 1,176 (+740%)
Mutual labels:  orm, web-framework
Jkmvc
Jkmvc is an elegant, powerful and lightweight MVC & ORM framework built using kotlin. It aims to be swift, secure, and small. It will turn java's heavy development into kotlin's simple pleasure. No spring.
Stars: ✭ 86 (-38.57%)
Mutual labels:  orm, web-framework
Gremlin Orm
gremlin-orm is an ORM for graph databases in Node.js
Stars: ✭ 136 (-2.86%)
Mutual labels:  orm
Grip
The microframework for writing powerful web applications.
Stars: ✭ 137 (-2.14%)
Mutual labels:  web-framework
Beginners C Program Examples
Simple, Short and Sweet beginners friendly C language programs
Stars: ✭ 138 (-1.43%)
Mutual labels:  template
Pymxget
mxget的Python实现
Stars: ✭ 136 (-2.86%)
Mutual labels:  aiohttp
Core
All of the required core code
Stars: ✭ 139 (-0.71%)
Mutual labels:  orm

jupiter

Build Status Codacy Badge License

jupiter是一个aio web框架,基于aiohttp。支持(restful格式、扫描注解、依赖注入、jinja2模板引擎、ORM框架)等。

核心组件介绍


1、jupiter_http(aio web框架)

介绍:基于aiohttp,扩展了扫描注解依赖注入jinja2模板引擎,支持各种请求方式。采取异步事件驱动充分发挥CPU性能。

安装

pip install jupiter_http

使用场景:开发web项目,想采取异步事件驱动模型,不想使用django、flask这些基于Python多线程的web框架时可以使用。

>>>>>>性能比较网址

示例代码

1、返回html(get请求)

@get('/')
async def index():
    return '<h1>hello world</h1>'

2、返回jinja2模板,模板是blogs1.html并携带__user__与blogs参数注入模板(get请求)

@get('/templates')
async def getTemplates():
    return {
        '__template__': 'blogs1.html',
        '__user__': {
            'name': 'jupiter'
        },
        'blogs': [
            {
                'id': uuid.uuid4().hex,
                'name': 'jupiter',
                'summary': 200,
                'created_at': 1501006589.27344
            }
        ]
    }

3、跳转,携带关键字redirect:可以进行跳转(get请求)

@get('/redirect')
async def redirect():
    return 'redirect:http://www.baidu.com'

4、POST请求,携带文件是表单请求,不携带文件是json请求(都支持,关键字file是表单中提取的文件)

@post('/api/examples')
async def api_register_user(request, *, userEmail, userName, userPassword, file=None):
    logging.info('userEmail:%s,userName:%s,userPassword:%s,file:%s' 
	% (userEmail, userName, userPassword, file))
    return {'result': 'success'}

5、jupiter_http框架的Demo(配置AioInit.py文件,然后启动此文件即可)

>>>>>>jupiter_http框架的Demo


2、jupiter_orm(aio ORM框架)

介绍:基于aiomysql,扩展了ORM操作数据库方式。

安装

pip install jupiter_orm

使用场景:操作数据库,想采取异步事件驱动模型,而非阻塞式操作数据库。

示例代码

1、创建实体类,继承ModelC

class TestModelC(ModelC):
    __table__ = 'example'

    id = StringFieldC(primary_key=True, default=uuid.uuid4().hex, ddl='varchar(64)')
    name = StringFieldC(ddl='varchar(255)')
    create_time = DoubleFieldC(default=time.time)
    status = TinyIntFieldC()
    num = IntFieldC()
    price = BigIntFieldC()
    content = TextFieldC()

2、查询列表

rs = await TestModelC.findAll(where="name='name'", limit=(0, 5), orderBy='id')

3、查询数量

num = await TestModelC.findNumber('count(id)', where="name='name'")

4、根据主键查询

user = await TestModelC.find('cd3dc2dab4b940a5b4dde8318a27a9d7')

5、插入

testModel = TestModelC(id=uuid.uuid4().hex, name='name', status=2, num=123, price=111111111119,
					   content='xxxxxxx')
result = await testModel.save()

6、修改

testModel.name = '23277732'
result = await testModel.update()

7、删除

testModel1 = TestModelC(id=testModel.id)
result = await testModel1.remove()

8、jupiter_orm的Demo(创建jupiterormtest.sql数据库,修改DBUnit.py配置,然后启动此文件即可)

>>>>>>jupiter_orm的Demo


更多详细介绍

>>>>>>jupiter_http详细介绍

>>>>>>jupiter_orm详细介绍

>>>>>>jupiter_config详细介绍

jupiter地址:

>>>>>>github

>>>>>>码云

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].