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.1.tar.gz (30.5 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.1-py3-none-win_amd64.whl (275.4 kB view details)

Uploaded Python 3Windows x86-64

sinv_textconv-0.1.1-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.1-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.1-py3-none-macosx_11_0_arm64.whl (318.5 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: sinv_textconv-0.1.1.tar.gz
  • Upload date:
  • Size: 30.5 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.1.tar.gz
Algorithm Hash digest
SHA256 9fd03c2adf7bd77ef322735afc079f0550dfae985e00e2e1338fb2ba208ae7ac
MD5 7d4dc506c6ee913e06c92dafa0905c1a
BLAKE2b-256 cb577e631c8bfc414f64ef69202c1f34d0b5684b0f9daf02fcf9263a1a8b5986

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sinv_textconv-0.1.1-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.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 2f5f933b36535c20384f63ffae9645d5f9814b93fa5d77a261419ef893dca816
MD5 e758c76b37dba4204e3b3ce3bfd7d47a
BLAKE2b-256 55ddcad7d95a648dd18a3f4871620db75b8e55ea0c6e4e3efb3a84721d8907b5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sinv_textconv-0.1.1-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.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9c2281c50b6018b29cd68ca44b73c605f991cb5744be48b3e25cd069ca9cd946
MD5 6469ed9c26da83f8566f936e28fcaa0f
BLAKE2b-256 9c20400ea79b270261cf796f2d5251df301dcc8f9002da75e7b9c2306c879bd0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sinv_textconv-0.1.1-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.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 dfa2b5e787a1f8b77e2d269353f1e3c8f468091cd40f9d4ac88a1abd50ee4a74
MD5 46f5b692242b2415a731f65e41d7aa04
BLAKE2b-256 6a5fb354a12e71ed8b33d39691f13c40635be1e637f4f072450119076d8ca923

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sinv_textconv-0.1.1-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 318.5 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.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f8efe1c5307fb7ae700a9ce8c867b75ecabcd4db5a0eb139ed893278f865a592
MD5 3868a5eb711fbc1a5020c8f75fa9443f
BLAKE2b-256 acab074a69c337d0108b90d4045785bc198026f2c35fca2a81825f7131030389

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