sillystrings
A Python reimplementation of the Unix strings utility. Extracts printable character sequences from binary files with support for multiple encodings, offset display, and standard CLI conventions.
Pure Python, zero dependencies, comprehensive test coverage.
Installation
Requires Python 3.11+.
Install from source using uv:
git clone https://github.com/jkomalley/sillystrings.git
cd sillystrings
uv sync
Usage
sillystrings [OPTIONS] [FILE ...]
With no file arguments, reads from stdin.
Options
| Flag | Description |
|---|---|
-n NUM |
Minimum string length (default: 4) |
-e {s,S,l,b} |
Character encoding: s = 7-bit ASCII (default), S = 8-bit, l = UTF-16 LE, b = UTF-16 BE |
-t {d,o,x} |
Print byte offset before each string in decimal, octal, or hex |
-w |
Include all whitespace characters (newlines, carriage returns) in strings |
-f |
Print the filename before each string |
-v |
Show version and exit |
Examples
Scan a binary for readable strings:
sillystrings /usr/bin/ls
Show hex offsets with 8-bit encoding:
sillystrings -t x -e S firmware.bin
Read from stdin:
cat firmware.bin | sillystrings -
Find wide (UTF-16 LE) strings with a minimum length of 8:
sillystrings -e l -n 8 program.exe
Architecture
The project is organized into three layers:
- encodings -- character-level printability checks for ASCII and UTF-16
- scanner -- accumulates printable runs into strings, tracks byte offsets
- cli -- argument parsing, file I/O, output formatting
Development
just install # or: uv sync && uv run pre-commit install
just check # format, lint, type check, and the test suite
Tests cover all encoding modes, offset calculations, CLI flags, edge cases, and integration via subprocess.
See CONTRIBUTING.md for development setup, project layout, and the conventions this repo follows.
License
MIT
Metadata
Release files for sillystrings 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sillystrings-0.1.0.tar.gz | 7.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sillystrings-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.0 kB
Release files / sillystrings-0.1.0.tar.gz
| Download URL | sillystrings-0.1.0.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d5102f532184108ba1b212b45231c529232391966153c49d5fa67d803a6cad41
|
|
BLAKE2b-256 checksum How to use checksums |
43451c69fca920934f335aa593f4c997a36dce2d55dc90338ffda5256380aa9a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.
Transparency logRelease files / sillystrings-0.1.0-py3-none-any.whl
| Download URL | sillystrings-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a3e1335eabb9fdc5ef7187a21c9b392b1ac1c52c33a3d6e20ec121d6ede1e939
|
|
BLAKE2b-256 checksum How to use checksums |
c300a2af0b609621bc9f3cd07e7e5e156af46ebd47dffcea81a5c8c25987aa55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.
Transparency log