Skip to main content

ToolSet

工具集合

安装

pip install toolset --upgrade

工具列表

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!'

Metadata

Release files for toolset 2019.6.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 toolset 2019.6.1
File Size Uploaded
toolset-2019.6.1.tar.gz 3.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for toolset 2019.6.1
File Interpreter ABI Platform
toolset-2019.6.1-py3-none-any.whl Python 3 none any Details

Total release size: 8.6 kB

Release files / toolset-2019.6.1.tar.gz

Download URL toolset-2019.6.1.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2863a8d59714f47c3a332300a107368ab6afd5790f7545ce5e52dae3cda7bbb4
BLAKE2b-256 checksum
How to use checksums
a49d88d2eb6f0c7e8064cac3ad0b48ee3e34ca81028fbad3330b9d96c14e0a45
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / toolset-2019.6.1-py3-none-any.whl

Download URL toolset-2019.6.1-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4bfefe9c5abeb3adce4c11ce9e458a374946ccbc613f607f6c47742b008c028d
BLAKE2b-256 checksum
How to use checksums
3cf939cbc6626653a95e051d43b388cdaa52d82b30df2806af64334db69c4413
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

2019.6.1 This release

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