The `svn` library by dsoprea is an intuitive Python wrapper for the Subversion (SVN) command-line client, compatible with Python 2.7 and 3.3+. It provides a lightweight interface for common SVN operations such as listing, getting info, logging, checking out, exporting, adding, committing, updating, and diffing. The library itself wraps the `svn` command-line executable, which must be installed separately on the system. The current version is 1.0.1, with its last release in February 2020.
pip install svnVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `svn.remote.RemoteClient` to check out a remote Subversion repository. It then uses `svn.local.LocalClient` to retrieve information about the newly created working copy. Remember to replace placeholder URLs and paths, and handle credentials as needed.
For older `diff` behavior, downgrade to `svn==0.3.46`. Otherwise, update your code to handle the new `diff` output format.
Ensure the Subversion command-line tools are installed on your operating system (e.g., `sudo apt-get install subversion` on Debian/Ubuntu, `brew install subversion` on macOS, or via official installers on Windows).
Update your exception handling from `except ValueError:` to `except svn.exception.SvnException:` to catch SVN-specific errors.