Skip to main content

做的一些工具包

Project description

yLIueTools

yLIueTools包含自己正在使用的一些python小工具

当前版本: 1.0.4

代码最新更新时间: 2025.09.22

github项目地址: yLIueTools

描述

每一个代码萌新都会自己尝试造轮子,这是我自己尝试写的方便自己用的小工具

可能有些功能会跟其他包冲突了,主要还是自己方便嘛

该包包含内容:

  • 方便调试和筛选输出信息的Debug模块

  • 方便输出带有颜色字体的Color模块

目录

1.描述

2.安装流程

3.Debug模块使用说明

4.Color模块使用说明

5.Update log

安装流程

使用pip进行安装

  pip install yliueTools

Debug模块使用说明

注意

Debug包会调用Color包的函数,Color的颜色显示不支持ANSI转义序列的终端会出现乱码的情况

你可以通过关闭颜色来让其正常显示

 debug = Debug("Test", _color=False)

初步使用

1.引入该包

 from MxTools import Debug

2.定义一个Debug对象

 # debug = Debug('project_name') 

 # project_name 为项目名称 type:str

 debug = Debug('Test')

3.使用Debug模块打印信息

 debug.log('Hello World!')

 # 输出

 # [2025-09-21 16:01:47,299] ING Test.default: Hello World!

筛选器教程

使用log打印时有3个参数

分别是 _msg(打印信息) _name(信息打印位置,默认为default) _type(类型,默认为ING)

我们可以在定义类的时候使用 _filterTyp_filterName 筛选器筛选自己想看的信息

 debug = Debug('Test',_filterType = 'ING', _filterName = 'default')

 # 筛选出类型为ING 发出位置为 default的打印信息

关闭Debug输出

  debug = Debug('Test', False)

API

Debug类

  Debug(_project: str, _debug: bool = True, _filterType: str = 'all', _filterName: str = 'all',_tips: bool = True, _color: bool = True)
  • _project 项目名称,必填项

  • _debug debug的开关,可以一键关闭所有输出

  • _filterType 类型筛选器

  • _filterName 发出位置筛选器

  • _tips 提示显示的开关

  • _color 可以关闭输出的字体颜色

.log

  .log(_msg, _name: str = 'default', _type: str = 'ING')
  • _msg 信息

  • _name 信息发出位置

  • _type 信息类型,已有参数会有颜色标识

_type已有参数
  • ING 正常运行

  • ERR 错误

  • PRIVATE 属于Debug内部信息

  • TIPS 提示信息,可以在定义类的时候使用 _tips = False 来关闭所有的提示信息

  • GLOBAL 全局变量

  • OUTPUT 接口输出

Color模块使用说明

注意

Color包的颜色显示不支持ANSI转义序列的终端会出现乱码的情况

初步使用

1.引入该包

from MxTools import Color

2.输出紫色字体

 print(Color.purple('Hello World!'))

ColorAPI

  • purple 紫色

  • grey 灰色

  • green 绿色

  • red 红色

  • blue 蓝色

  • yellow 黄色

  • cyan 青色

Update log

Ver1.0.1 2025.09.21 第一次上传

Ver1.0.2 2025.09.22 修改部分编写错误 debug.rEnd修复了文件夹读取与实际不符合的bug,不要使用没提到的功能,即便它有,这极其不稳定

Ver1.0.3 2025.09.22 修改了自叙文件的编写错误

Ver1.0.4 2025.09.22 修复Debug筛选器筛选问题,加入了屏蔽提示的开关,更好的自叙文件

筛选器Bug...这个真是核心的问题,都是因为自己不够小心,Orz不好意思qaq,幸好没人用

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

yliueTools-1.0.4.tar.gz (5.1 kB view details)

Uploaded Source

File details

Details for the file yliueTools-1.0.4.tar.gz.

File metadata

  • Download URL: yliueTools-1.0.4.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for yliueTools-1.0.4.tar.gz
Algorithm Hash digest
SHA256 97a82e3ecf3b97045eb72c38e2131876f47719950524bd7b61286341ac9f7620
MD5 06361595f2fd93523aeb5d538352528b
BLAKE2b-256 575c77e3bce6988ffd06ee03b88aed3cc2800789abcd18be7a7882feba1e0d8a

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