Skip to main content

Tool set.

Project description

ToolSet

English | 中文

Tool set.

Install

pip3 install toolset --upgrade

ToolList

Combiner

List all combinations of elements.

from toolset.combiner import Combiner

for item in Combiner(ele_set=[1, 2, 3], min_eles=1, max_eles=2):
    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: element set.
  • min_eles: minimum number of elements.
  • max_eles: maximum number of elements.

get_localhost

Get local host.

>>> from toolset import get_localhost
>>> localhost = get_localhost()
localhost: 192.168.0.112

get_md5

Get the file md5 value.

>>> from toolset import get_md5
>>> file_md5 = get_md5('demo.txt')
file_md5: 2e37db575bdab271fbd8d36e29afd737

text_encryptor

Encrypt/decrypt text.

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


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.5.20.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

toolset-2019.5.20-py3-none-any.whl (5.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page