Skip to main content

一套实用的 Python 工具库,包含日志、时间处理和多线程相关的工具函数

Project description

Ginkgo Tools

一套实用的 Python 工具库,包含日志、时间处理和多线程相关的工具函数。

功能模块

日志工具 (tools_log)

  • console_log_debug: 标准的打印函数,输出时间、内容、调用的文件和函数,便于调试和问题追踪

时间工具 (tools_time)

多线程工具 (tools_threading_target)

安装

pip install ginkgo-tools

使用示例

日志工具使用示例

from ginkgo_tools import console_log_debug

# 打印调试信息
console_log_debug("这是一条调试信息", "变量值:", variable)

# 异常处理中的日志打印
try:
    # 一些可能出错的代码
    pass
except Exception:
    console_log_debug("发生异常", onException=True)

时间工具使用示例

from ginkgo_tools import (
    trans_timestr_to_datetime, 
    get_week_range, 
    create_time_mark
)

# 时间字符串转换
dt = trans_timestr_to_datetime("2024-03-08T16:34")

# 获取本周时间范围
week_start, week_end = get_week_range()

# 创建时间标记
time_mark = create_time_mark()

多线程工具使用示例

from ginkgo_tools import Base_Operation_Threading_Target

class MyThreadTask(Base_Operation_Threading_Target):
    def run(self):
        # 实现具体的任务逻辑
        pass

# 创建并启动线程任务
task = MyThreadTask(target_object, operation_dict)
task.start()

支持的 Python 版本

  • Python 3.6
  • Python 3.7
  • Python 3.8
  • Python 3.9
  • Python 3.10
  • Python 3.11

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

ginkgo_tools-0.1.3.1.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

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

ginkgo_tools-0.1.3.1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file ginkgo_tools-0.1.3.1.tar.gz.

File metadata

  • Download URL: ginkgo_tools-0.1.3.1.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for ginkgo_tools-0.1.3.1.tar.gz
Algorithm Hash digest
SHA256 630e55cc73cf89e4a9e8e5f39868329ab899cb52e72787132e13f5aae7c9d528
MD5 f6329c8d56a6b52d3d71562bf6843278
BLAKE2b-256 2ed6c65d7185a784c8fb41e3668332406f3fecc63ddb33e05643b01953782142

See more details on using hashes here.

File details

Details for the file ginkgo_tools-0.1.3.1-py3-none-any.whl.

File metadata

  • Download URL: ginkgo_tools-0.1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for ginkgo_tools-0.1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5aaaae838a043881b5827fc9ffbab5afb9792f3533cf99707e6102f82c595d99
MD5 0673e3f7ea30a5da330f0e9868c445aa
BLAKE2b-256 2af060e83fa775b120f7108fbeec6c99b485a7c59f395a3579479db256dc7318

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