Skip to main content

Sphinx directive to render deterministic monochrome hexdumps from binary files

Project description

sphinxcontrib-hexdump

sphinxcontrib-hexdump is a Sphinx extension that renders files as classic monochrome hexdumps using a reStructuredText directive.

Features

  • Reads any file type as raw binary bytes.
  • Produces deterministic output with pure Python formatting.
  • Emits a single literal code block that works consistently in HTML and LaTeX builders.
  • Supports offset/length/line limiting for large files.

Installation

pip install sphinxcontrib-hexdump

For local development:

pip install -e .[test]

Enable the extension

Add to conf.py:

extensions = [
    "sphinxcontrib.hexdump",
]

Directive usage

.. hexdump:: ../artifacts/firmware.elf
   :bytes-per-line: 16
   :start: 0
   :length: 256
   :max-lines: 64

Lowercase bytes are optional:

.. hexdump:: ../artifacts/firmware.elf
   :lowercase:

Example output

00000000  48 65 6C 6C 6F 2C 20 68  65 78 64 75 6D 70 21 0A  Hello, hexdump!.

Options

  • :bytes-per-line: integer >= 1, default 16
  • :lowercase: flag; if present, byte hex values are lowercase (default is uppercase)
  • :start: integer >= 0, default 0
  • :length: integer >= 0, default 0 (read until EOF)
  • :max-lines: integer >= 0, default 0 (no line limit)

Notes

  • Paths are resolved relative to the Sphinx source directory (env.srcdir).
  • Files outside the docs directory are allowed if they exist.
  • For very large files, prefer :length: and/or :max-lines: to keep output size bounded.

Release

  • TestPyPI and PyPI publishing workflows are included in .github/workflows/.
  • Full release steps are documented in PUBLISHING.md.

Compatibility

  • Python 3.10+
  • Sphinx 6.2+

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinxcontrib_hexdump-0.1.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinxcontrib_hexdump-0.1.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file sphinxcontrib_hexdump-0.1.1.tar.gz.

File metadata

  • Download URL: sphinxcontrib_hexdump-0.1.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sphinxcontrib_hexdump-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e86764442e171494d0dc9e3beb1d517b07853e1871798e3c03f223fbda720af7
MD5 5c74cc4de1a84b33f44d6e4774ed76ef
BLAKE2b-256 a2ab3541b9318fbbdd246b9db5e28f1155535a4fb5ba52d96ae83d5ff8d48145

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinxcontrib_hexdump-0.1.1.tar.gz:

Publisher: publish.yml on idduarte/sphinxcontrib-hexdump

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sphinxcontrib_hexdump-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinxcontrib_hexdump-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4090e13dde3376206f39a6877313efdf615adf9c3b95ac76676fae71526de9f6
MD5 280ab1b73a5996913ebfc588787a4ac9
BLAKE2b-256 05af621e7d9c5942d4d937c6392bedd9adc47ddc6513c57f91f6230fe48c7030

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinxcontrib_hexdump-0.1.1-py3-none-any.whl:

Publisher: publish.yml on idduarte/sphinxcontrib-hexdump

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page