Skip to main content

fuscan

极速通用文件扫描器.

PyPI CI Python License Coverage

基于 YAML 规则的多格式文件内容扫描工具,支持 CLI 与 GUI(PySide2 + QML)。可扫描 PDF、Office 文档、压缩包等多种格式,按文件名/内容/路径匹配并支持 AND/OR/NOT 逻辑组合。

特性

  • 规则引擎:YAML 配置规则,支持文件名、文件内容、路径三类匹配目标,contains/equals/regex 等多种模式,AND/OR/NOT 逻辑组合
  • 多格式支持:PDF、DOCX、PPTX、XLSX、ODT/ODS、WPS、纯文本,及 ZIP/RAR 压缩包内扫描
  • 两种使用形态
    • CLI:scan/rules/gui/cache/version 子命令,支持 text/json/csv 输出
    • GUI:PySide2 + QML 极简界面(Sidebar + ContentArea),实时进度、结果分类、详情预览、关键词高亮
  • 内置通用规则:随包分发 8 条安全规则,用户规则可覆盖
  • 多规则合并:支持加载多个规则文件,按顺序链式合并,后者覆盖前者同名规则

安装

pip install fuscan

或使用 uv

uv add fuscan

GUI 需要 PySide2(仅支持 Python 3.8~3.10)。

快速上手

CLI

# 扫描指定路径(默认使用内置通用规则)
fuscan scan /path/to/scan

# 使用自定义规则文件,输出 JSON 报告
fuscan scan /path/to/scan -r rules/custom.yaml -o json -f report.json

# 加载多个规则文件(后者覆盖前者同名规则)
fuscan scan /path/to/scan -r base.yaml -r override.yaml

# 校验规则文件格式
fuscan rules -r rules/custom.yaml

# 启动 GUI
fuscan gui

GUI

fuscan gui

GUI 提供 GitHub Desktop 风格界面:模式卡片选择扫描范围(全盘/盘符/文件夹)、规则文件列表管理、实时进度反馈(当前文件/已扫描/命中/错误/已用时)、结果分类展示与详情预览(关键词高亮)、扫描结果导出(CSV/JSON)。

规则配置

规则文件为 YAML 格式,详见 rules/example.yaml

version: "1.0"

ignore_dirs:
  - .git
  - node_modules

rules:
  # 文件名匹配
  - name: 敏感文件名检测
    severity: warning
    match:
      type: filename
      mode: contains
      pattern: password

  # 内容正则匹配
  - name: AWS 密钥泄露检测
    severity: critical
    match:
      type: content
      mode: regex
      pattern: 'AKIA[0-9A-Z]{16}'

  # AND 逻辑组合:配置文件含敏感词
  - name: 配置文件敏感词
    severity: warning
    match:
      type: and
      children:
        - type: filename
          mode: regex
          pattern: '\.(conf|ini|ya?ml)$'
        - type: content
          mode: contains
          pattern: password

更多场景化规则示例见 rules/examples/

开发

# 安装开发依赖
uv sync --extra dev

# 全套门禁(lint + typecheck + coverage)
make check

# 运行测试
uv run pytest -m "not slow" --cov=fuscan --cov-fail-under=96

# 构建 Sphinx 文档
make doc

# 多版本测试(tox)
make tox

更多 Make 快捷命令运行 make help 查看。

许可证

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fuscan-0.3.3.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

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

fuscan-0.3.3-py3-none-any.whl (921.7 kB view details)

Uploaded Python 3

File details

Details for the file fuscan-0.3.3.tar.gz.

File metadata

  • Download URL: fuscan-0.3.3.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fuscan-0.3.3.tar.gz
Algorithm Hash digest
SHA256 4921f8bf943d0c97bd8a1b9e7632cc94fdc3de1fe9e817e062a21185ae3e2a6b
MD5 d719c322a6200606ce7a8a2b7de78000
BLAKE2b-256 472306f7f3be089cadc9a986275c0ff2561e434460e0218e224cd48ba79859fb

See more details on using hashes here.

File details

Details for the file fuscan-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: fuscan-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 921.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fuscan-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d55617418065706eb2db84020688a6241f7668c688b8d726c7f8c3d4c6c0ef40
MD5 82dac3ef6085023de16c71c29c31482d
BLAKE2b-256 760f26d37f8ad1e182da0dc19ade12ab31fd4fe0448fcec8e4d3d4976ecbc31a

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.8

2 files

0.3.7

2 files

0.3.6

2 files

0.3.5

2 files

This release

0.3.3 This release

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.20

2 files

0.2.19

2 files

0.2.18

2 files

0.2.17

2 files

0.2.16

2 files

0.2.15

2 files

0.2.14

2 files

0.2.11

2 files

0.2.10

2 files

0.2.9

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.0

2 files

0.1.8

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page