pyftype
一个类型检测库。
特性
类型检测完全模块化,需要检测新的类型,直接参考modules中的检测,编写即可。
主要面向逆向工程方向的类型检测,也支持一般类型检测。
安装
❯ pip install pyftype
❯ pyftype -h
usage: pyftype [-h] [-V] p
positional arguments:
p path
options:
-h, --help show this help message and exit
-V, --version show program's version number and exit
❯ pyftype Makefile
File extension: txt
File MIME type: application/txt
用法
import pyftype
# file
f = open(path, "rb")
data = f.read()
kind = pyftype.guess(data)
# path
kind = pyftype.guess(path)
# bytes
buf = bytearray([0xFF, 0xD8, 0xFF, 0x00, 0x08])
kind = pyftype.guess(buf)
具体参考examples目录
参考
Metadata
Release files for pyftype 1.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyftype-1.2.4-py3-none-any.whl | Python 3 | none | any | Details |
Release files / pyftype-1.2.4-py3-none-any.whl
| Download URL | pyftype-1.2.4-py3-none-any.whl |
|---|---|
| Size | 13.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f58cce4a98276355f5c392c8295fc131aeee5b086f2e0e4953770849c8feb48c
|
|
BLAKE2b-256 checksum How to use checksums |
0a6a5eb1dc61829df04db7ac6e37602bbc416b3853aaa9ee8e2cc8807d9c4665
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.11 CPython/3.10.0 Darwin/20.6.0
|
Security for pyftype 1.2.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.