# New(ish) Release: sphobjinv v2.1

sphobjinv v2.1 is out!

(Well, it’s actually been out for a few months, but I’m only just now getting around to writing this post about it.)

Per SemVer, since this release bumps the minor version number, no backward-incompatible changes to the API should have occurred. If you find any, please file a bug report. No guarantees about the CLI, however.

#### Python Version Support

First, v2.1 officially drops Python 3.5 support, which went end-of-life in September 2020. Given that major ecosystem tools such as pip have done the same, I’m pretty comfortable with the decision.

(Plus, moving to 3.6+ allowed me to roll out f-strings throughout the codebase, which was NICE.)

In parallel, v2.1 adds Python 3.10 support, in anticipation of the 4 Oct 2021 release date for 3.10.0 final.

#### New Features

• API
• Function/method arguments referring to files on disk now can be type str or pathlib.Path (previously they had to be str). See #176.
• CLI
• Support added for read/write from/to stdin/stdout (see #131 and #137)
• Plaintext and JSON inventory contents can be read from stdin for both convert and suggest modes by passing a hyphen to infile.
• Plaintext and JSON inventory contents can be emitted to stdout for the convert mode by passing a hyphen to outfile.
• When generating JSON from a remote inventory using the CLI (via sphobjinv convert json -u), the URL of the remote objects.inv is included at {root}.metadata.url (see #138).

#### Bug/Behavior Fixes

• More-intutive equality comparisons are now implemented for Inventory and DataObjStr/DataObjBytes instances.
• Two DataObjStr (or DataObjBytes) instances compare equal if all of name, domain, role, priority, uri and dispname are equal.
• Two Inventory instances compare equal if .project and .version are equal, and the contents of .objects are identical in each.
• Objects with name values that contain spaces are now imported correctly, instead of being skipped (see #181 – thanks to Hynek Schlawack for the bug report!).
• In certain cases, objects can have a zero-length uri; such objects are now correctly imported (see #183).
• These issues prompted a detailed review of Sphinx’s actual object import behavior, with a subsequent expansion of the test suite to closely probe that behavior (see test_valid_objects.py).
• The User-Agent header for URL-based CLI and API invocations was de-anonymized, so that objects.inv download requests will now be attributed to sphobjinv (see #162).
• A [speedup] extra was added, for more convenient co-installation of the optional python-Levenshtein dependency on POSIX/MacOS (see #175).