当前仓库属于暂停状态,部分功能使用受限,详情请查阅 仓库状态说明
1 Star 0 Fork 14

yalukezoudike / jupiter
暂停

forked from 电霸儿 / jupiter
暂停
 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

jupiter

Build Status Codacy Badge License

jupiter是一个AIO web框架,能够快速开发高性能web项目。支持扫描注解、过滤、模板、ORM等。

github:

https://github.com/dianbaer/jupiter

码云:

https://gitee.com/dianbaer/firstaio

1、jupiter_http

jupiter_http是一个AIO Web框架,扩展了aiohttp,增加扫描注解、过滤、模板等功能。

安装:

pip install jupiter_http

代码示例:

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

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

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

@get('/register')
async def register():
	return {
		'__template__': 'register1.html'
	}

@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'}

例子:

jupiter_http_test

jupiter_http详细介绍

2、jupiter_orm

jupiter_orm是一个AIO ORM框架,扩展了aiomysql,能够通过对象操作数据库。

安装:

pip install jupiter_orm

代码示例:

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()
	

rs = await TestModelC.findAll(where="name='name'", limit=(0, 5), orderBy='id')
logging.info(rs)
num = await TestModelC.findNumber('count(id)', where="name='name'")
logging.info(num)
user = await TestModelC.find('cd3dc2dab4b940a5b4dde8318a27a9d7')
logging.info(user)
testModel = TestModelC(id=uuid.uuid4().hex, name='name', status=2, num=123, price=111111111119,
					   content='xxxxxxx')
result = await testModel.save()
logging.info(result)
testModel.name = '23277732'
result = await testModel.update()
logging.info(result)
testModel1 = TestModelC(id=testModel.id)
result = await testModel1.remove()
logging.info(result)

例子:

jupiter_orm_test

jupiter_orm详细介绍

3、jupiter_config

安装:

pip install jupiter_config

jupiter_config详细介绍

上传至pypi

windows 创建文件

type NUL > .pypirc

.pypric文件放入home目录下

	[distutils]
	index-servers =
	  pypi

	[pypi]
	repository=https://pypi.python.org/pypi
	username=your_username
	password=your_password

检查	
python setup.py check

打包
python setup.py sdist

上传
python setup.py sdist upload -r pypi
MIT License Copyright (c) 2017 电霸儿 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

jupiter是一个AIO web框架,能够快速开发高性能web项目。支持扫描注解、过滤、模板、ORM等。 展开 收起
Python
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Python
1
https://gitee.com/yalukezoudike/firstaio.git
git@gitee.com:yalukezoudike/firstaio.git
yalukezoudike
firstaio
jupiter
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891