Skip to main content

文件和目录操作工具包

Project description

liwancai-DirsFile

文件和目录操作工具包

安装

pip install liwancai-DirsFile

使用方法

from DirsFile import Save_Toml, Read_Toml, Mkdir

# 或者导入所有功能
from DirsFile import *

功能列表

基础文件操作

  • GetthisPyPath() - 获取当前脚本路径
  • SplitDiv() - 分离盘符与路径
  • SplitDir() - 文件路径和文件分离
  • DirName() - 取路径中文件夹路径
  • FileName() - 取路径中文件
  • FileEND() - 分离后缀名
  • Mkdir() - 创建文件夹
  • FileSize() - 获取文件尺寸
  • MoveTO() - 移动文件
  • CopyTo() - 复制文件
  • ReName() - 文件重命名
  • Del_P() - 删除文件夹
  • Del_F() - 删除文件

目录操作

  • Pathsdirs() - 路径下文件夹
  • Pathsname() - 路径下文件夹名称
  • Del_NanP() - 删除空文件夹
  • Scan_File() - 查找目录下所有文件
  • EndWithPath() - 获取指定后缀名的文件路径

文件读写

  • SavePickle() - 保存状态
  • LoadPickle() - 加载状态
  • WriteFile() - 写入文件
  • ReadFile() - 读取文件
  • ReadLine() - 按行读取文件
  • Save_Json() - 保存json文件
  • Read_Json() - 读取json文件
  • Read_Csv() - 读取csv文件
  • Read_Xls() - 读取xls文件
  • Save_Csv() - 保存csv文件
  • TodoCsv - CSV文件操作类

哈希计算

  • File_Hash_MD5() - 文件MD5哈希
  • File_Hash_SHA_256() - 文件SHA-256哈希
  • Str_Hash_MD5() - 字符串MD5哈希
  • Str_Hash_SHA_256() - 字符串SHA-256哈希

图像处理

  • ImgToBase64() - 图片转base64
  • Base64_img() - base64编码
  • Base64ImgSave() - base64转图片

网络传输

  • FTP_Link() - FTP连接
  • FTP_DWload() - FTP下载
  • FTP_UPload() - FTP上传

压缩解压

  • un_zip() - 解压zip文件
  • un_gz() - 解压gz文件
  • un_tar() - 解压tar文件
  • In_tar() - 压缩tar.gz文件
  • In_zip() - 压缩zip文件

配置管理

  • Save_Toml() - 保存Toml配置文件
  • Read_Toml() - 读取Toml配置文件

系统命令

  • Run_Cmd() - 执行cmd命令

目录树

  • DirectionTree - 目录树生成类
  • Path_Tree() - 文件目录树

依赖

  • liwancai-PyLog
  • toml

可选依赖

  • pandas (用于CSV/Excel操作)
  • Pillow (用于图像处理)

许可证

MIT License

作者

liwancai (QQ: 248411282)

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

liwancai_dirsfile-1.0.3.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

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

liwancai_dirsfile-1.0.3-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file liwancai_dirsfile-1.0.3.tar.gz.

File metadata

  • Download URL: liwancai_dirsfile-1.0.3.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for liwancai_dirsfile-1.0.3.tar.gz
Algorithm Hash digest
SHA256 bf78698cb3fdd368ae4c4216a6788f59675655d4723ee0d1be845e186a0a9e6f
MD5 041e8c6176936a0710ec0805b04b07d1
BLAKE2b-256 3c429622dc9b708986cc72a09f3fffa51a664ab95eae1146d763bb0ceb307ece

See more details on using hashes here.

File details

Details for the file liwancai_dirsfile-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for liwancai_dirsfile-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 dccfa25ca28d9c0aa18adbf345c3092b079d492cda2c5975ffe599b8481c4904
MD5 0b83c9e3e07e5ab1f79caedb966265f1
BLAKE2b-256 50a4467db78e054d816105190919c0c584c99ef797c2f23f3b37eb1820280bf3

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