Registry / devops / svn
library1.0.1pypypi✓ verified 88d ago

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 svn
INSTALL
IMPORT
SIG · SVN
S
svn
devopspythonv1.0.1
Install
2.7s avg
Import
103ms
Disk
19MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v1.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.110s · 21.3MB
glibc
py 3.10–3.920 runs
installs and imports cleanly · install 2.7s · import 0.097s · 22MB
19MB installed
● package 19MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

LocalClient
✓ from svn.local import LocalClient
✗ import svn.local

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.

import svn.remote import os # Example: Checkout a remote repository # Replace with your actual repository URL and desired local path repo_url = os.environ.get('SVN_REPO_URL', 'https://example.com/svn/myproject/trunk') local_path = os.environ.get('SVN_LOCAL_PATH', '/tmp/myproject_working_copy') if not os.path.exists(local_path): print(f"Checking out '{repo_url}' to '{local_path}'...") try: r = svn.remote.RemoteClient(repo_url) # For repositories requiring credentials: # r = svn.remote.RemoteClient(repo_url, username='myuser', password='mypassword') r.checkout(local_path) print("Checkout successful.") # Example: Get info about the checked out working copy local_client = svn.local.LocalClient(local_path) info = local_client.info() print("\nWorking copy info:") for key, value in info.items(): print(f" {key}: {value}") except svn.exception.SvnException as e: print(f"SVN Error: {e}") except Exception as e: print(f"An unexpected error occurred: {e}") else: print(f"'{local_path}' already exists. Skipping checkout.") print("You can use svn.local.LocalClient to interact with it.")
Debug
Known issues
breakingThe `diff` implementation was re-written in version 1.0, making it backwards-incompatible. If your application relies on the older `diff` output, you must pin your dependency to version `0.3.46` or earlier.
fix
For older `diff` behavior, downgrade to `svn==0.3.46`. Otherwise, update your code to handle the new `diff` output format.
affects: >=1.0.0
gotchaThe Python `svn` library is a wrapper around the Subversion command-line client. The `svn` executable must be installed on the system where the Python code runs and be accessible in the system's PATH.
fix
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).
affects: All versions
gotchaFrom version 1.0 onwards, exceptions related to SVN repository issues are raised as `svn.exception.SvnException`, replacing `ValueError`.
fix
Update your exception handling from `except ValueError:` to `except svn.exception.SvnException:` to catch SVN-specific errors.
affects: >=1.0.0
Upgrade
Version history
1.0.1latest on PyPI · released Feb 1, 2020
Audit
Dependencies
Subversion (svn) command-line clientrequiredThis Python library wraps the external `svn` command-line tool, which must be installed and accessible in the system's PATH.
Agent activity
39 hits · last 30 days
node
36
OpenAI (training)
1
Resources
svn — pip install svn · libregistry