sharkdp

content_inspector

Fast inspection of binary buffers to guess/determine the type of content

by sharkdp

Rust

Rust91.3%
Python8.7%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

2 of 6 standards met

Community profile →
42
✓README✓License○Contributing○Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Quiet · 1 in progress · Last activity 8y ago
See all on GitHub →
joaquinrodriguez6

Summary This pull request introduces Python bindings for , implemented with PyO3 and packaged with maturin. The bindings reside in an isolated crate; the main crate, its dependency tree, and its public API remain unchanged. Motivation provides a fast heuristic for distinguishing text from binary content, which is useful beyond the Rust ecosystem. Exposing it to Python allows data-processing and security tooling written in Python to reuse the same detection logic without reimplementing it. Public API returns a with , and (e.g. , , ). Design Isolation. The crate declares its own and depends on the parent crate by path. No modification is made to the root . Bounded I/O. File inputs read only the first 1024 bytes, which is the maximum that considers. The read loops until 1024 bytes are obtained or end-of-file is reached, since may return fewer bytes than requested. Portability.** The extension is built with , so a single wheel per platform supports Python 3.8 and later. Continuous integration A new workflow, , builds wheels with , installs them, and runs the test suite on Linux, macOS, and Windows. It is triggered only by changes to , , or the workflow itself, and therefore does not affect existing Rust development. Testing covers for bytes and paths, text and binary inputs, and the repository's fixtures. The tests were run locally against a freshly built wheel.

joaquinrodriguez6 · 1mo ago
arslansadiq

Hi, I am not very good with Rust programming language. Can you please provide C/C++ version of this library or just provide a simple pseudo code for this? Regards

arslansadiq · 6y ago
nifr

Hey @sharkdp, 1.) I discovered that right now there are 4 releases for this lib (the latest being ) but the "Latest release" on github is still shown as for me. See /releases. 2.) Could you add a to the releases as you've done for your other tools? That'd make installation with provisioning tools (, , ... etc) a breeze. I'm looking to provision to my systems and use it with the flag of to speed up checking for binary files. Thanks for all the work you put into these helpers. Greatly appreciated!

nifr · 7y ago
igor-raits

This is requirement for Apache-2.0 license and it simplifies packaging of tihs crate for linux distributions. Thanks in advance!

igor-raits · 8y ago
Structured data for AI agents

Repository: sharkdp/content_inspector. Description: Fast inspection of binary buffers to guess/determine the type of content Stars: 47, Forks: 4. Primary language: Rust. Languages: Rust (91.3%), Python (8.7%). License: Apache-2.0. Topics: binary, encoding, rust, text. Latest release: v0.2.4 (7y ago). Open PRs: 1, open issues: 0. Last activity: 8y ago. Community health: 42%. Top contributors: sharkdp.