Skip to main content

metabeam (Python)

Point it at any file and read everything inside.

metabeam is a metadata extraction engine for any file type. It detects formats by their magic bytes (never the file extension), runs every applicable parser, and returns a structured report as a plain Python dict: hashes and entropy, image geometry, EXIF and GPS, audio tags, video timing, document properties, archive contents, and binary headers.

The package is a compiled Rust extension (built with maturin and PyO3), so parsing is fast and the result matches the CLI and Node packages exactly.

Install

pip install metabeam

Supports CPython 3.8+ on Linux, macOS, and Windows.

Usage

import metabeam

# Parse a file from disk. Raises OSError if it cannot be read.
report = metabeam.parse("photo.jpg")

print(report["file"]["mime_detected"])    # "image/jpeg"
print(report["file"]["sha256"])           # full hex digest
print(report["jpeg"]["quality_estimate"]) # estimated JPEG quality
print(report["exif"]["gps_decimal"])      # {"latitude": ..., "longitude": ...}

Parse bytes that never touch disk (an upload, a download, a database blob):

with open("photo.jpg", "rb") as f:
    report = metabeam.parse_bytes(f.read())

The result is a plain dict, so it serializes directly:

import json
print(json.dumps(report, indent=2))

Validate that an upload is really the type it claims

Because detection is by content, not extension, metabeam is a reliable way to reject spoofed uploads:

import metabeam

def is_real_png(data: bytes) -> bool:
    report = metabeam.parse_bytes(data)
    return report["file"]["mime_detected"] == "image/png"

API

  • metabeam.parse(path: str) -> dict - parse a file on disk.
  • metabeam.parse_bytes(data: bytes) -> dict - parse an in-memory buffer.

Every result contains a file namespace (size, detected MIME, SHA-256, CRC-32, entropy). Format-specific namespaces (jpeg, png, exif, id3, mp4, pdf, zip, elf, and more) are added when they apply, so a single file can produce several at once.

Supported formats

JPEG, PNG, GIF, BMP, WebP/WAV/AVI (RIFF), TIFF/HEIC EXIF, MP3 (ID3), MP4/MOV/M4A/HEIF, ELF binaries, PDF, gzip, and the ZIP family (docx, xlsx, pptx, jar, apk, epub). The universal file namespace runs on everything.

License

Licensed under either of MIT or Apache-2.0 at your option.

Metadata

Release files for metabeam 0.1.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 metabeam 0.1.0
File Size Uploaded Provenance Actions
metabeam-0.1.0.tar.gz 39.3 kB Without provenance Details for metabeam-0.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for metabeam 0.1.0
File Actions
metabeam-0.1.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for metabeam-0.1.0-cp312-cp312-win_amd64.whl
metabeam-0.1.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for metabeam-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
metabeam-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.12+ x86-64 Details for metabeam-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl
metabeam-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details for metabeam-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
metabeam-0.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ ARM64 Details for metabeam-0.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Total release size: 2.1 MB

Release files / metabeam-0.1.0.tar.gz

Download URL metabeam-0.1.0.tar.gz
Size 39.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6b003b75189f33782f53d246754c44109aa6f3f874cee79e867078ca7f46e5a8
BLAKE2b-256 checksum
How to use checksums
bcd6557913ef8df118bbe28b3aa2825afd2e3e3d559d06caabc681e2b7a8872c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / metabeam-0.1.0-cp312-cp312-win_amd64.whl

Download URL metabeam-0.1.0-cp312-cp312-win_amd64.whl
Size 309.3 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
8a723f800776f35701d06875cbfcf3f19e966b811ab8502efd1b85eb768b471a
BLAKE2b-256 checksum
How to use checksums
add63198453bd699553e274d12acf252d4869755940d8e0ef8094abbe27be7c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / metabeam-0.1.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL metabeam-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Size 422.3 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
355fbcf81d68078bcfed9fd80f3080002353202e4a0e47833d665db46e612b30
BLAKE2b-256 checksum
How to use checksums
be9622082a40e1e1c9d4528574b49222dc588c3d0e55457026aa5dd04f9ca939
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / metabeam-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl

Download URL metabeam-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl
Size 424.6 kB
Tags CPython 3.12 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
941e7ea86f991e5b2587e8f5ba7a647530f95d42b5c7893e0f163441330db3c7
BLAKE2b-256 checksum
How to use checksums
8b5424f43fa12bd5bee4807805edb8c808a35281a342a8cc4c8a154773b5c3b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / metabeam-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL metabeam-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 476.2 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
1ab980daf904b7c0ab32bb32b5cbf9f7e54dceebbe02d559407cd1ed0c3c76e4
BLAKE2b-256 checksum
How to use checksums
09407f4fc823511848165da42e7f2a280e7852165ad114cda1b11a2381c800a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / metabeam-0.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL metabeam-0.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 474.3 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
aa9c31abc1da0e8336f9e59eb1349b68fa13d7db17ee0e7ae41b3b80851bec97
BLAKE2b-256 checksum
How to use checksums
f015d387a39be9fb4178d19d521a561d9310d54bd13847f808bb947cdad0405b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Security for metabeam 0.1.0

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

6 release files No provenance

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