Skip to main content

some usual tool

Project description

DerrickTools工具

提供包含但不限于各种加密算法的实现、时间戳和各种格式时间字符串之间的转换等功能

安装

pip install derrick-tools

使用

  • 日期时间工具

from DerrickTools.engine.datetime.main import DateTimeTool    # 导入function_tool_derrick.UsualTool下的DateTimeTool类

if __name__ == '__main__':
    print(DateTimeTool.timestamp2time(1681721029)) # 打印 2023-04-17 16:43:49
    print(DateTimeTool.time2timestamp('2023-04-17 16:43:49')) # 打印 1681721029

    ret = DateTimeTool.get_range_of_date_by_str('2022-02-02 15:30:28', formatter='%Y-%m-%d %H:%M:%S', tsType=TimestampType.MILLISECOND)
    print(ret) # 打印 [1643731200000, 1643817599999]

    print(DateTimeTool.get_difference_between_time('2024-02-20 08:30:00', '2024-02-20 08:31:30'))   # 打印90
  • 加密算法工具

    from DerrickTools.engine.secret.main import Encoder, Decoder
    md5_secret_text = Encoder.md5_encode("你好")
    print(md5_secret_text)
    
    origin_text = "Hello World"
    bs64_str = Encoder.base64_encode(origin_text)
    decoder_str = Decoder.base64_decode(bs64_str)
    print(bs64_str, decoder_str)
    

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

derrick-tool-0.0.1.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

derrick_tool-0.0.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file derrick-tool-0.0.1.tar.gz.

File metadata

  • Download URL: derrick-tool-0.0.1.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.8.19

File hashes

Hashes for derrick-tool-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f8cdccd2899a8d66e46287d5026587831b059e3e013802125f03bb61fbe9c524
MD5 3714e9958f9c829fcb8964e8a24e4ba9
BLAKE2b-256 f2ded3dead5605a94a6d3badd772647708dc43e649f448f5121f646f748da869

See more details on using hashes here.

File details

Details for the file derrick_tool-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: derrick_tool-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.8.19

File hashes

Hashes for derrick_tool-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 16e0a84a4f7e03d296249cfaa5a4a466e7c7829448a649f41e9b7b6738dbf840
MD5 dda69cacf5aa854eb76e12c23e86c8b1
BLAKE2b-256 a7a972b49efd8266e7c784794ac4bf6af16cd61ea1d41e44e011006122ffcdcb

See more details on using hashes here.

Supported by

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