tfmcutil
介绍
文本文件合并、分割模块:练习用的小模块。
模块结构
tfmcutil 模块包含一个 TextFiles 类,文件的分割、合并通过该类实例的 sizedfiles、onefile 方法完成。
安装教程
python3 -m pip install tfmcutil
使用说明
# 假设以下文件都存在且路径正确
from tfmcutil import TextFiles
f1 = TextFiles(("test.txt", "utf-8"))
f2 = TextFiles("test1.txt", ("test2.txt", "ascii"))
f3 = f1 + f2
print(len(f3)) # 实例中包含的文件数
print(f3.items()) # 实例中所有的 (文件路径, 编码) 元组
f3.onefile("result.txt") # 合并成一个文件
f3.sizedfiles(1000, "sized.txt") # 按字符数分割成多个文件, sized_1.txt、sized_2.txt ...
f4 = TextFiles.fromstring("测试内容\n第二行测试内容", "new.txt") # 将字符串写入 "new.txt" 并保存,返回 TextFiles 实例
f5 = f4 + f1
print(f5.totalsize()) # 返回实例中所有文件大小总和,单位字节
# 更多请查看源代码或 help(TextFiles)
参与贡献
- Fork 本仓库
- 新建 feat_xxx 分支
- 提交代码
- 新建 Pull Request
特技
- 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
- Gitee 官方博客 blog.gitee.com
- 你可以 https://gitee.com/explore 这个地址来了解 Gitee 上的优秀开源项目
- GVP 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
- Gitee 官方提供的使用手册 https://gitee.com/help
- Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 https://gitee.com/gitee-stars/
Metadata
Release files for tfmcutil 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tfmcutil-0.0.2.tar.gz | 7.5 kB | Without provenance | Details for tfmcutil-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tfmcutil-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for tfmcutil-0.0.2-py3-none-any.whl |
Total release size: 14.2 kB
Release files / tfmcutil-0.0.2.tar.gz
| Download URL | tfmcutil-0.0.2.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6bbe50bfc95d3a52049137789f68cd07b0c880dba2d64c3c371b22948751e27d
|
|
BLAKE2b-256 checksum How to use checksums |
ee56539dd25fbc85632dfc0c615b81035fd4902cd15a463cff5b7456f78cc3b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.9
|
Release files / tfmcutil-0.0.2-py3-none-any.whl
| Download URL | tfmcutil-0.0.2-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7d0d7aaa4e29e43022f40dd6c0afb77df3268cd7237ad50545c752ca7fe49c05
|
|
BLAKE2b-256 checksum How to use checksums |
9b032e1bd145179093f5434f48ec2f5d1496356fb2c3542565ff3dae87d91b09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.9
|
Security for tfmcutil 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.