Skip to main content

sinv-textconv

License: MIT codecov crates.io PyPI Version

A fast git textconv driver for Sphinx inventory files (objects.inv)

sinv-textconv is a cli program for use as a git textconv option to view diffs between Sphinx inventory files (typically called objects.inv). textconv is a git configuration option to instruct git to use a certain program to convert binary files to plain text so that a diff can be displayed.

If you keep objects.inv in your history, (or want to diff them yourself) this program offers a fast and convenient way to do that.

This project is directly modeled after sphobjinv-textconv, but we are around 15x times faster on a benchmark of the linux kernel docs inventory file. (see the benchmark section)

Table of Contents

Features

sinv-textconv is kept intentionally minimal in functionality so it is as light weight as possible and is optimized for its intended use case instead for cli convenience.

Specifically this means that:

  1. It takes exactly one argument, that being the path to an inventory file, and it will output the contents of that file in plaintext over stdout
  2. The contents of the file are NOT parsed, and instead the entire zlib content is dumped directly into stdout. This is because it's not uncommon for Sphinx to produce references that don't conform to the format and thus can't be parsed (like happens in the linux kernel docs). You might still want to see the diff for these, hence the decision to not parse the contents.

If you are looking for an application that is more optimized for direct user interaction and does parse the contents please see sinv. I've decided to publish these as separate programs mostly to keep the cli of sinv better suited for direct user interaction, and the git textconv cli comes with somewhat strict requirements.

Installation

You can install the binary simply form PyPi using your favourite method:

uv tool install sinv-textconv

If you prefer you can also install it from crates.io:

cargo install sinv-textconv

If you wish you can also of course build it from source:

cargo install --git https://github.com/aslowwriter/sinv-textconv

Usage

After you installed the program, you can have git use it automatically as a "diff driver" by adding the following lines to a .gitconfig (can be either user, system, or repo-specific):

 [diff "objects_inv"]
        textconv = sinv-textconv

After that you'll need to associate a file glob with that driver, by adding these lines to .gitattributes (again can be system, user or repo-specific):

*.inv diff=objects_inv

Then any diff you show through other means should be able to show you a nice plaintext diffs of the files.

If you want to simply inspect the file you can do that by piping it into your favourite pager, like normal:

sinv-textconv foo.inv | less

In case you want to do one-off diffs of files that aren't in a repository you can use process substitution:

diff <(sinv-textconv foo.inv) <(sinv-texconv bar.inv)

Note once again that this conversion is only one way and does not parse the contents to check them for correctness. If you want a tool that does those things please see sinv

Benchmarks

Comparing to [sphobjinv-textconv] when operating on the linux kernel documentation inventory file, we perform significantly faster:

a horizontal bar graph showing the average time to parse the linux kernel docs objects.inv on a logarithmic scale. There are two bars: sinv-textconv(41.74 ms) and sphobjinv-textconv (623.30 ms)

To run the benchmarks yourself I recommend you have the following tools installed (though only hyperfine and cargo are required):

  • cargo to compile the project
  • hyperfine for running the benchmarks and generating the timing data
  • uv to manage the dependencies of and run the python script for generating the plot
  • just to run the commands
  • curl for downloading the objects.inv file

if you have all these, running the benchmarks should be as easy as

just benchmark

this will:

  1. download the linux kernel docs object file
  2. compile the project
  3. use hyperfine to run the benchmarks
  4. run the plotting script through uv

Note: As with any benchmark the actual value of the timings may be quite different than the ones in the plot, but the relative ordering of the implementations should remain the same.

I've done my best to make the comparison as fair as possible, but if you know of ways we can be more accurate in our comparison please open an issue!

FAQ

Q. How do you pronounce it?

A. I pronounce it ess-inv-textconv, but I'm not a perscriptivist so pronounce it however you like.

Q: What's the status of the project?

A: Currently the project is mostly "done." That means that it does what I need it to do for now, so it may not see regular updates. However, I'm happy to take bug reports and feature requests, and may implement functionalities as needed. The project is still maintained, but I'd rather wait to have actual usecases we can address properly rather than implement a bunch of features nobody is interested in.

Acknowledgements

Thank you to Brian Skinn et al. for all the research they did into the format and for writing sphobjinv which this program is directly modeled after.

Download files

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

Source Distribution

sinv_textconv-0.1.2.tar.gz (30.8 kB view details)

Uploaded Source

Built Distributions

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

sinv_textconv-0.1.2-py3-none-win_amd64.whl (275.4 kB view details)

Uploaded Python 3Windows x86-64

sinv_textconv-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (347.6 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

sinv_textconv-0.1.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (361.8 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ i686

sinv_textconv-0.1.2-py3-none-macosx_11_0_arm64.whl (318.6 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file sinv_textconv-0.1.2.tar.gz.

File metadata

  • Download URL: sinv_textconv-0.1.2.tar.gz
  • Upload date:
  • Size: 30.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for sinv_textconv-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1c80180089465f0ab3da5c21f63cdc665149c20057275e50f2ebf6a7e50eab5b
MD5 b1567a76f1f0e71660eb44a60d7cda61
BLAKE2b-256 a6eb6979dc5f5210c77bc348b97d6f01ea515803313c4671df2506bd34b0b60f

See more details on using hashes here.

File details

Details for the file sinv_textconv-0.1.2-py3-none-win_amd64.whl.

File metadata

  • Download URL: sinv_textconv-0.1.2-py3-none-win_amd64.whl
  • Upload date:
  • Size: 275.4 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for sinv_textconv-0.1.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 bf5996cce6b82a8c1c8455165b3a6f39d8047ec5feca4689e1cfd2f0b60f5341
MD5 70c01d38de9706870106d590b9a1d3dd
BLAKE2b-256 3a18f34aeab7da3a39211a592625a5ff4410106ecb9f022e65e5b31e151efe7e

See more details on using hashes here.

File details

Details for the file sinv_textconv-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: sinv_textconv-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 347.6 kB
  • Tags: Python 3, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for sinv_textconv-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 953672f910afb1b8f19b43e87b2de3047d93dd6fc6626e9bb84f2c5b03f57d8a
MD5 2ca493899abdacf4319d51d93d5a94e7
BLAKE2b-256 02258deb0a12378dca8bc3c12dc6eb884b74aa6f42841630b0bcae195d51bbdd

See more details on using hashes here.

File details

Details for the file sinv_textconv-0.1.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

  • Download URL: sinv_textconv-0.1.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
  • Upload date:
  • Size: 361.8 kB
  • Tags: Python 3, manylinux: glibc 2.17+ i686
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for sinv_textconv-0.1.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 afdde7b0c4eecf51f77d76ac9c0312931f4d703542addd9d33778b8ad0a1495a
MD5 31c85b62ff427695e3e28fa0055ad990
BLAKE2b-256 5df90752e7bdb51dd71fee9e8932a69cd76fbf2e1ccf8b56a2ff0d78e7d78518

See more details on using hashes here.

File details

Details for the file sinv_textconv-0.1.2-py3-none-macosx_11_0_arm64.whl.

File metadata

  • Download URL: sinv_textconv-0.1.2-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 318.6 kB
  • Tags: Python 3, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for sinv_textconv-0.1.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c4e481117da79759ed369b4a2b13e687e56b20a611eb44ee3a1c028cc9dcb609
MD5 153299326fd8a14575cd5be5216de9b2
BLAKE2b-256 6bf7586044672844c98e8ea9eb20f8ee10d5b8368888cac053b5ee3ae9d240e9

See more details on using hashes here.

Supported by

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