Skip to main content

常用 Python 组件

Project description

user_tools

一些个人常用的模块。 The English README

注意:

user_tools v2.0.0 以上版本与之前版本代码完全不一致,若正在使用旧版本代码,请指定 user_tools<=2.0.0

当前代码为进行完整测试,可能存在一些 bug,会在后续使用中进行处理

以下文件中的代码可能存在风险,使用时请提前检查安全风险。
user_tools.common.ucmd.py: 未对待执行的命令进行安全检查。
user_tools.db.umysql.py: 未对待执行的 SQL 进行安全检查
user_tools.file.ucompress.py: 未对压缩包文件进行检查。尤其在 Unix 系统使用 tarfile 插件时需要注意
user_tools.file: 所有对文件的修改,都允许删除或强行覆盖,使用时需要注意。

目录

背景

  • 在项目开发过程中, 涉及很多相同的功能, 每次编写相同的代码很浪费时间, 且并不是每次都能想到具体的实现代码, 因此开发了这个 Python 模块, 包含了常用的一些方法。

安装方式

  • 由于此模块已发布到 PyPi, 所以可以直接使用 pip 进行安装, 命令为: pip install user_tools

使用方法

  • 这是一个 user_tools.common.utime 的使用示例:
from user_tools.common import utime

# 输出给定的时间是否符合给定的时间格式, 默认时间格式为 %Y-%m-%d %H:%M:%S
is_time = utime.validate_datetime('2024-01-01 10:10:10')

相关项目

  • 暂无。若有已知被使用的开源项目, 会在这里标注

注意:

可能存在已被使用的开源代码或基于开源代码进行的二次开发。因本工具主要方便个人使用, 且开源代码来源未知, 所以未注明具体来源 如果您认为侵权, 请通过邮件或 GitHub 联系我删除。 如果我知道代码的来源, 我会加以说明。

开源协议

  • 此项目使用的开源协议为: GNU LGPLv3

待办

  • user_tools.network.ussh: 未实现

  • user_tools.db: 增加 sqlite、ck 查询方法

  • user_tools.file.uexcel: 增加写文件/读文件方法,并且独立单个 Sheet 写入方法

  • user_tools.file.ufile: 增加文件清理逻辑

  • user_tools.file.ufile: 中需要考虑读写的换行符问题。同时增加入参,用于指定是否需要对每行数据进行 strip

  • user_tools.file.upath: 增加文件查找功能, 参考 path_get 方法, 增加 ignore_dict 参数

  • user_tools.network: 新建 uapi.py 文件, 构建默认 API 方法

  • user_tools.network.unet: 增加网络校验功能, 如端口检测, ping 检测, 后续增加 IP 信息的方法, 如CIDR地址格式, 地址排序等等。

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

user_tools-2.0.0.tar.gz (28.2 kB view details)

Uploaded Source

Built Distribution

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

user_tools-2.0.0-py3-none-any.whl (35.0 kB view details)

Uploaded Python 3

File details

Details for the file user_tools-2.0.0.tar.gz.

File metadata

  • Download URL: user_tools-2.0.0.tar.gz
  • Upload date:
  • Size: 28.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for user_tools-2.0.0.tar.gz
Algorithm Hash digest
SHA256 f23210c7ce6bd27a4d3dc714950f35fe03966d22069e9fcaba11d00fa59fcc4f
MD5 8474dcaf2ddb9afebb9b8006ab6449ff
BLAKE2b-256 df40df3db80991f636c67edc8cff2d2044d7b0ad5a620fd084075f3f1a800737

See more details on using hashes here.

File details

Details for the file user_tools-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: user_tools-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 35.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for user_tools-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d83afe8fee9adec6e3762d95961de2247e7a460fe712833ff70492b2d2a6b2a4
MD5 ec8b11e8dbbd1c4cb97ff3dc500c396d
BLAKE2b-256 bbbfcadd68671a845f14cf3870a1fd63a50bba374ef9383c5b0baefada6fbacd

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