Skip to main content

This is a package for handling error files

Project description

ErrorFile

ErrorFile是一个用于检测和识别各种文件错误的Python包,包括图片、PDF、Excel和Word文件。通过使用不同的检测模式,可以快速或精确地识别文件中的潜在问题。

安装

你可以通过pip安装ErrorFile

pip install ErrorFile

快速开始

使用ErrorFile非常简单。首先,导入FileInspector类,然后创建一个实例,并指定要检查的文件路径和(可选的)检查模式。

示例

from ErrorFile.Detection.FileInspector import FileInspector

file_path = 'TestFiles/test.pdf'
image_mode = 'precise'  # 或 'fast'
result = FileInspector(file_path, image_mode).inspect()
print(result)

支持的文件类型

目前,ErrorFile支持以下文件类型的检查:

  • 图片(JPEG, JPG, PNG, GIF, BMP, WEBP, TIFF, SVG)
  • PDF
  • Excel(XLSX, XLS)
  • Word(DOCX)

检测模式

对于图片文件,支持两种检测模式:

  • fast:快速检测模式,适用于快速概览和检查大量文件。
  • precise:精确检测模式,适用于深入分析单个文件。

对于PDF、Excel和Word文件,将自动采用详细检测模式。

API参考

FileInspector

主要的类,用于初始化文件检查过程。

参数

  • file_path:要检查的文件路径。
  • image_mode:(可选)图片检查模式,默认为precise

方法

  • inspect():执行文件检查,并返回检查结果。

贡献

欢迎贡献!如果你有任何建议或改进,请提交Pull Request或创建Issue。

许可证

ErrorFile根据Apache-2.0许可证发布。有关详细信息,请查看LICENSE文件。

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

ErrorFile-0.1.1.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distributions

ErrorFile-0.1.1-py3-none-any.whl (7.4 kB view hashes)

Uploaded Python 3

ErrorFile-0.1.1-py2.py3-none-any.whl (7.4 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page