aioredisRedis 的 Python 开发包
aioredis 是基于 Asyncio 实现的异步 Redis 的 Python 开发包。
要求:
示例代码:
import asyncio import aioredis loop = asyncio.get_event_loop() @asyncio.coroutine def go(): conn = yield from aioredis.create_connection( ('localhost', 6379), loop=loop) yield from conn.execute('set', 'my-key', 'value') val = yield from conn.execute('get', 'my-key') print(val) conn.close() loop.run_until_complete(go()) # will print 'value'
连接池:
import asyncio import aioredis loop = asyncio.get_event_loop() @asyncio.coroutine def go(): pool = yield from aioredis.create_pool( ('localhost', 6379), minsize=5, maxsize=10, loop=loop) with (yield from pool) as redis: # high-level redis API instance yield from redis.set('my-key', 'value') print((yield from redis.get('my-key'))) pool.clear() # closing all open connections loop.run_until_complete(go()
评论
redis-pyRedis 的 Python 开发包
redis-py这是Redis目前最成熟的Python客户端开发包。示例代码:>>> import redis>>> r = redis.Redis(host='l
redis-pyRedis 的 Python 开发包
0
GitpylibGit 的 Python 开发包
Gitpylib是Git的Python开发包。Gitpylib提供很多常用的Git特性,抽象了Git操作。
GitpylibGit 的 Python 开发包
0
py-leveldbLevelDB的Python开发包
py-leveldb是Google的K/V数据库LevelDB的Python客户端开发包。示例代码:importleveldbdb=leveldb.LevelDB('./db')#singleputd
py-leveldbLevelDB的Python开发包
0
githubpyGitHub的Python开发包
githubpy是专门为GitHubAPI编写的PythonSDK。根据GitHub的API文档说明,就可以轻松调用API。例如,获取issues列表的API说明如下:GET/repos/:owner
githubpyGitHub的Python开发包
0
PyExchangeExchange 的 Python 开发包
PyExchange是微软Exchange服务的Python封装。Python应用可以使用它来与Exchange服务进行各种交互。该库目前还不完善,只支持日程信息。示例代码:from pyexchan
PyExchangeExchange 的 Python 开发包
0
PyExchangeExchange 的 Python 开发包
PyExchange 是微软 Exchange 服务的 Python 封装。Python 应用可以使
PyExchangeExchange 的 Python 开发包
0