Giter VIP home page Giter VIP logo

errorfile's Introduction

ErrorFile

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

安装

你可以通过pip安装ErrorFile

pip install ErrorFile

快速开始

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

示例

from Detection.FileInspector import FileInspector

file_path = r'TestFiles\TOM_损坏.jpg'
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文件。

errorfile's People

Contributors

hellohistory avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

shzhbook

errorfile's Issues

Deleted package detected

I'm a Cyber Security researcher and developer of PackjGuard [1] to address open-source software supply chain attacks.

Issue

During my research, I detected a deleted package in this repository.

Details

Specifically, the package ErrorFile mentioned in file README at line 9 does not exist on the public PyPI registry. A bad actor can hijack this package to propagate malicious code.

Impact

Not only your apps/services using https://github.com/Hellohistory/ErrorFile repo code are vulnerable to this attack, but the users of your open-source Github repo could also fall victim.

You could read more about such attacks here: https://medium.com/@alex.birsan/dependency-confusion-4a5d60fec610

Remediation

Please highlight this in file README and register a placeholder package for ErrorFile on public PyPI soon to remediate.

To automatically fix such issues in future, please install PackjGuard Github app [1].

Thanks!

  1. PackjGuard is a Github app that monitors your repos 24x7, detects vulnerable/malicious/risky open-source dependencies, and creates pull requests for auto remediation: https://github.com/marketplace/packjguard

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.