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.5.tar.gz (1.6 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.5-py3-none-any.whl (932.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fuscan-0.3.5.tar.gz
  • Upload date:
  • Size: 1.6 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.5.tar.gz
Algorithm Hash digest
SHA256 56a5ae09f846eae698b73356029dbde17512367d4685767df2b569319d0b5050
MD5 0f8eb951b562b4c75039ee7e76f51a0d
BLAKE2b-256 f06741bf3c7acdb000025ce687594dccbdef394b0dcd2a576c7d34aa9f288afc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fuscan-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 932.2 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 db8470fdf1d342d357b3b28f7539b1d22a1267008b63214d2240d60bd788a4e1
MD5 095837dad991558b555c3515846b8fb9
BLAKE2b-256 10c4f1984e8978dd261998cb18965e17e2b3218897e42cb4407298939409fd8f

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

This release

0.3.5 This release

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

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