Skip to main content

py-filesearcher

py-filesearcher是一个Python库,用于实现各类文件中特定字符的识别。

特点

支持文档类型包括

  • 文本文件: .py, .c, .txt, .md
  • OFFICE文件: .docx, .xls, .xlsx
  • 压缩文件: .zip

安装

你可以使用 pip 安装 py-filesearcher:

pip install py-filesearcher

使用

import pathlib
from py_filesearcher.indexer import Indexer

indexer = Indexer(
    search_dir=pathlib.Path("") / "data",
    index_dir=pathlib.Path("index")
)

match_contents = indexer.query_reg("world")
for m in match_contents:
    print(f"文件名: [{m.filename}], 匹配内容: [{[x.decode('utf8') for x in m.match_text]}]")

Metadata

Release files for py-filesearcher 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-filesearcher 0.2.0
File Size Uploaded
py_filesearcher-0.2.0.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for py-filesearcher 0.2.0
File Interpreter ABI Platform
py_filesearcher-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.2 kB

Release files / py_filesearcher-0.2.0.tar.gz

Download URL py_filesearcher-0.2.0.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c48b536e305a28581074d70c03439e20b1b56afa60aede4fdb0ff1f8f2f77655
BLAKE2b-256 checksum
How to use checksums
e8ac7fd4a9790625bb7a32f29c3e15652151f8aa2265142d5e5955caeae8e7c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.8.8 Windows/10

Release files / py_filesearcher-0.2.0-py3-none-any.whl

Download URL py_filesearcher-0.2.0-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bbe1dd0425a42a86c19220be10e15e3b90387d44f37f64cce93b7abd5d910bbe
BLAKE2b-256 checksum
How to use checksums
e56bacb462c461ce7315627214ccbafe7bef029ca2e2bbac4f4d47293c2e3c9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.8.8 Windows/10

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release 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