Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

humanish

Detect a file's real format from its magic bytes (not its extension) and get a human-readable summary of what's inside it.

Supports PNG, JPEG, BMP, WAV, MP3, ZIP, TAR, GZIP, PDF, PE (EXE/DLL), ELF, and MP4. Pure standard library, no dependencies.

Install

pip install humanish

Usage

from humanish import humanish, detect_format

detect_format("mystery.bin")          # -> "png"

humanish("photo.jpg")
# {
#   "format": "jpeg",
#   "width": 1920,
#   "height": 1080,
#   "components": 3,
#   ...
# }

Detect from bytes you already have in memory:

from humanish import detect_format_from_bytes

detect_format_from_bytes(open("mystery.bin", "rb").read(64))

Command line

humanish path/to/file

Prints the format and content summary as JSON.

License

MIT

About

Identify a file's true format from its magic bytes and extract structured metadata from its contents

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages