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.

Metadata

Release files for sinv-textconv 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sinv-textconv 0.1.2
File Size Uploaded
sinv_textconv-0.1.2.tar.gz 30.8 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for sinv-textconv 0.1.2
File
sinv_textconv-0.1.2-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
sinv_textconv-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
sinv_textconv-0.1.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl Python 3 none Linux glibc 2.17+ x86-32 Details
sinv_textconv-0.1.2-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details

Total release size: 1.3 MB

Release files / sinv_textconv-0.1.2.tar.gz

Download URL sinv_textconv-0.1.2.tar.gz
Size 30.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1c80180089465f0ab3da5c21f63cdc665149c20057275e50f2ebf6a7e50eab5b
BLAKE2b-256 checksum
How to use checksums
a6eb6979dc5f5210c77bc348b97d6f01ea515803313c4671df2506bd34b0b60f
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / sinv_textconv-0.1.2-py3-none-win_amd64.whl

Download URL sinv_textconv-0.1.2-py3-none-win_amd64.whl
Size 275.4 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
bf5996cce6b82a8c1c8455165b3a6f39d8047ec5feca4689e1cfd2f0b60f5341
BLAKE2b-256 checksum
How to use checksums
3a18f34aeab7da3a39211a592625a5ff4410106ecb9f022e65e5b31e151efe7e
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / sinv_textconv-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL sinv_textconv-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 347.6 kB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
953672f910afb1b8f19b43e87b2de3047d93dd6fc6626e9bb84f2c5b03f57d8a
BLAKE2b-256 checksum
How to use checksums
02258deb0a12378dca8bc3c12dc6eb884b74aa6f42841630b0bcae195d51bbdd
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / sinv_textconv-0.1.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl

Download URL sinv_textconv-0.1.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Size 361.8 kB
Tags Linux glibc 2.17+ x86-32 Python 3
SHA-256 checksum
How to use checksums
afdde7b0c4eecf51f77d76ac9c0312931f4d703542addd9d33778b8ad0a1495a
BLAKE2b-256 checksum
How to use checksums
5df90752e7bdb51dd71fee9e8932a69cd76fbf2e1ccf8b56a2ff0d78e7d78518
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / sinv_textconv-0.1.2-py3-none-macosx_11_0_arm64.whl

Download URL sinv_textconv-0.1.2-py3-none-macosx_11_0_arm64.whl
Size 318.6 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c4e481117da79759ed369b4a2b13e687e56b20a611eb44ee3a1c028cc9dcb609
BLAKE2b-256 checksum
How to use checksums
6bf7586044672844c98e8ea9eb20f8ee10d5b8368888cac053b5ee3ae9d240e9
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release history Release notifications | RSS feed

This release

0.1.2 This release

5 release files

0.1.1

5 release files

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