Tool set.
Project description
ToolSet
工具集合
安装
pip install toolset --upgrade
工具列表
- Combiner : 列举所有元素组合.
- get_localhost : 获取本地
host
. - get_md5 : 获取文件
MD5
值. - text_encryptor : 对文本加密/解密.
Combiner
#####列举所有元素组合
from toolset.combiner import Combiner
combiner = Combiner(ele_set=[1, 2, 3], min_eles=1, max_eles=2)
for item in combiner:
print(item)
# print: [1], [2], [3], [1, 1], [1, 2], [1, 3], [2, 1], [2, 2], [2, 3], [3, 1], [3, 2], [3, 3]
- ele_set: 元素集合.
- min_eles: 最小元素个数.
- max_eles: 最大元素个数.
随机获取元素组合
print(combiner.random())
# print: [2, 1]
get_localhost
获取本地 host.
>>> from toolset import get_localhost
>>> localhost = get_localhost()
localhost: 192.168.0.112
get_md5
获取文件 MD5 值.
>>> from toolset import get_md5
>>> file_md5 = get_md5('demo.txt')
file_md5: 2e37db575bdab271fbd8d36e29afd737
text_encryptor
对文本加密/解密.
>>> from toolset import TextEncryptor
>>> ciphertext = TextEncryptor.encrypt(token='123456', text='hello world!')
ciphertext: b'gAAAAABc4qW9v-0UH0nuVkv9749QDm_8NCJmvWMHcnqSWx8WX1nOiO8Zi-kRmKmVjGQdsn1buoQV8wTCcI-7uHGutQ6tAVQQ4A=='
>>> text = TextEncryptor.decrypt(token='123456', ciphertext=ciphertext)
text: 'hello world!'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
toolset-2019.6.1.tar.gz
(3.1 kB
view details)
Built Distribution
File details
Details for the file toolset-2019.6.1.tar.gz
.
File metadata
- Download URL: toolset-2019.6.1.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2863a8d59714f47c3a332300a107368ab6afd5790f7545ce5e52dae3cda7bbb4 |
|
MD5 | fa639e3ab4cda313877e647b18b05115 |
|
BLAKE2b-256 | a49d88d2eb6f0c7e8064cac3ad0b48ee3e34ca81028fbad3330b9d96c14e0a45 |
File details
Details for the file toolset-2019.6.1-py3-none-any.whl
.
File metadata
- Download URL: toolset-2019.6.1-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bfefe9c5abeb3adce4c11ce9e458a374946ccbc613f607f6c47742b008c028d |
|
MD5 | 351f5e6d0651179579b96afba4ef60e8 |
|
BLAKE2b-256 | 3cf939cbc6626653a95e051d43b388cdaa52d82b30df2806af64334db69c4413 |