Skip to main content

Table of Content

Name

pykit: A collection of python libs those are used in project s2: Storage-Service at baishancloud.com

Status

This library is in beta phase.

It has been used heavily in our object storage service, as a foundamental library of our devops platform.

Description

Module List

There is a README.md for each module.

name description
argchecker Validates arguments against the schema
aws AWS error codes and so on
awssign Sign a request by using aws signature version 4
cacheable Cache data which access frequently
cachepool Reusable object cache in process
cgrouparch Build cgroup directory tree, add set cgroup pid
cluster Some helper function for the server in a cluster
csvutil Utility functions for CSV file loading and conversion
daemonize Start, stop or restart a daemon process
dictutil Dictionary helper utility
ectypes Utility functions for the server
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
jobscheduler Run jobs at certain time
logcollector Collect logs of interest locally
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 json.dump and json.load in utf-8 encoding
utfyaml Force yaml.dump and yaml.load in utf-8 encoding
wsjobd Job daemon based on websocket protocol
zktx Transaction implementation on Zookeeper
zkutil Utility functions for zookeeper

Module dependency

Install

Just clone it and copy it into your project source folder.

cd your_project_folder
git clone https://github.com/baishancloud/pykit.git

Usage

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

Configuration

See config.md

Test

Run one of following to test all, a module, a TestCase or a function.

./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

See Details

For developer

There are several scripts for developers. See script.

Author

Zhang Yanpo (张炎泼) drdr.xp@gmail.com

Copyright and License

The MIT License (MIT)

Copyright (c) 2015 Zhang Yanpo (张炎泼) drdr.xp@gmail.com

Release files for pykit-bsc-s2 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pykit-bsc-s2 1.0.1
File Size Uploaded
pykit-bsc-s2-1.0.1.tar.gz 226.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pykit-bsc-s2 1.0.1
File Interpreter ABI Platform
pykit_bsc_s2-1.0.1-py2-none-any.whl Python 2 none any Details

Total release size: 536.2 kB

Release files / pykit-bsc-s2-1.0.1.tar.gz

Download URL pykit-bsc-s2-1.0.1.tar.gz
Size 226.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e1f0fe3a886a2ea7cdd97cf7d2e99ab86f927ab0be99eff1343de285b85035ec
BLAKE2b-256 checksum
How to use checksums
b53b1f265f14dd9f43ed73910129d7c39a26826ee64354cb90524aa7dfb048a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pykit_bsc_s2-1.0.1-py2-none-any.whl

Download URL pykit_bsc_s2-1.0.1-py2-none-any.whl
Size 309.6 kB
Tags Python 2
SHA-256 checksum
How to use checksums
3cb5b38e1e0788229ecc709b760d29c40aa047e57322908956e1224830281859
BLAKE2b-256 checksum
How to use checksums
d4e2aeb762148e75200c361caf086bfc58b1e783ea225d37a583ef699afdd958
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page