python中用于分布式系统开发的工具包库集合
pykit-bsc的Python项目详细描述
目录
名称
皮基特: python lib的集合,这些lib用于项目s2:storage service 白山云
状态
这个库处于测试阶段。
它在我们的对象存储服务中被大量使用,作为基础 我们的DevOps平台的库。
说明
模块列表
每个模块都有一个README.md
。
name | description |
---|---|
argchecker | Validates arguments against the schema |
aws | AWS error codes and so on |
cacheable | Cache data which access frequently |
cachepool | Reusable object cache in process |
cluster | Some helper function for the server in a cluster |
daemonize | Start, stop or restart a daemon process |
dictutil | Dictionary helper utility |
etcd | etcd client |
fsutil | File-system Utilities |
heap | Min heap |
http | HTTP/1.1 client |
humannum | Convert number to human readable number string |
jobq | Process serial of input elements with several functions concurrently and sequentially |
logutil | Utility functions to create logger or make log message |
mime | Utility functions to handle mime type |
modutil | Submodule Utilities |
mysqlconnpool | Mysql connection pool with MySQLdb in python |
mysqlutil | Mysql related datatype, operations |
net | Network utility |
portlock | cross process lock |
priorityqueue | Priority queue |
proc | Utility to create sub process |
rangeset | Segmented range. |
ratelimiter | rate limiter |
redisutil | For using redis more easily. |
shell | Set different command arguments to execute different functions |
strutil | A collection of helper functions used to manipulate string |
threadutil | Utility functions for better management of threads |
timeutil | Support specify time format output and get current ts, ms, us api etc |
utfjson | Force ^{ |
utfyaml | Force ^{ |
wsjobd | Job daemon based on websocket protocol |
zkutil | Utility functions for zookeeper |
模块依赖性
安装
只需克隆它并将其复制到项目源文件夹中。
cd your_project_folder
git clone https://github.com/baishancloud/pykit.git
用法
from pykit import jobq
def add1(args):
return args + 1
def printarg(args):
print args
jobq.run([0, 1, 2], [add1, printarg])
# > 1
# > 2
# > 3
配置
测试
运行以下任一项测试全部、模块、测试用例或函数。
./script/t
./script/t zkutil
./script/t zkutil.test
./script/t zkutil.test.test_zkutil
./script/t zkutil.test.test_zkutil.TestZKUtil
./script/t zkutil.test.test_zkutil.TestZKUtil.test_lock_id
对于开发者
有几个脚本供开发人员使用。 见script。
作者
张艳波(音译)drdr.xp@gmail.com
版权和许可
麻省理工学院许可证(MIT)
版权所有(c)2015张艳波