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.2.2.tar.gz (891.7 kB view details)

Uploaded Source

Built Distribution

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

fuscan-0.2.2-py3-none-any.whl (377.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fuscan-0.2.2.tar.gz
  • Upload date:
  • Size: 891.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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.2.2.tar.gz
Algorithm Hash digest
SHA256 574242b105bc0345451742e15080a55ed31b52d5c98b1f42bf0157a4ef5fb9d9
MD5 0bb3e17607a4ab0f379bba5b43af1205
BLAKE2b-256 088401620d32bbd971dd6e8a4a183a929007d87c3b678a38898369ec1e7329ff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fuscan-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 377.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1311c6b3bb80a825d47f8dee8bc07427707f85f8d25f3dd533024eab8f03f1aa
MD5 1426c7a68e7b63054237c967218d442a
BLAKE2b-256 a01ec436bc000c8b20d231c6c0fa22c5f36bb700a817127ebb5689e5a36cd8dc

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

0.3.3

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

This release

0.2.2 This release

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