{"id":8692,"library":"svn","title":"Subversion Command-Line Wrapper (svn)","description":"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.","status":"active","version":"1.0.1","language":"python","source_language":"en","source_url":"https://github.com/dsoprea/PySvn","tags":["svn","subversion","vcs","version-control","wrapper","command-line"],"install":[{"cmd":"pip install svn","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"This Python library wraps the external `svn` command-line tool, which must be installed and accessible in the system's PATH.","package":"Subversion (svn) command-line client","optional":false}],"imports":[{"wrong":"import svn.local","symbol":"LocalClient","correct":"from svn.local import LocalClient"}],"quickstart":{"code":"import svn.remote\nimport os\n\n# Example: Checkout a remote repository\n# Replace with your actual repository URL and desired local path\nrepo_url = os.environ.get('SVN_REPO_URL', 'https://example.com/svn/myproject/trunk')\nlocal_path = os.environ.get('SVN_LOCAL_PATH', '/tmp/myproject_working_copy')\n\nif not os.path.exists(local_path):\n    print(f\"Checking out '{repo_url}' to '{local_path}'...\")\n    try:\n        r = svn.remote.RemoteClient(repo_url)\n        # For repositories requiring credentials:\n        # r = svn.remote.RemoteClient(repo_url, username='myuser', password='mypassword')\n        r.checkout(local_path)\n        print(\"Checkout successful.\")\n\n        # Example: Get info about the checked out working copy\n        local_client = svn.local.LocalClient(local_path)\n        info = local_client.info()\n        print(\"\\nWorking copy info:\")\n        for key, value in info.items():\n            print(f\"  {key}: {value}\")\n\n    except svn.exception.SvnException as e:\n        print(f\"SVN Error: {e}\")\n    except Exception as e:\n        print(f\"An unexpected error occurred: {e}\")\nelse:\n    print(f\"'{local_path}' already exists. Skipping checkout.\")\n    print(\"You can use svn.local.LocalClient to interact with it.\")","lang":"python","description":"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."},"warnings":[{"fix":"For older `diff` behavior, downgrade to `svn==0.3.46`. Otherwise, update your code to handle the new `diff` output format.","message":"The `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.","severity":"breaking","affected_versions":">=1.0.0"},{"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).","message":"The 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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Update your exception handling from `except ValueError:` to `except svn.exception.SvnException:` to catch SVN-specific errors.","message":"From version 1.0 onwards, exceptions related to SVN repository issues are raised as `svn.exception.SvnException`, replacing `ValueError`.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.1':76 '2.7':28 '2020':83 '3.3':30 'ad':49 'check':46 'client':24 'command':3,22,61,92 'command-lin':2,21,60,91 'commit':50 'common':37 'compat':25 'control':89 'current':73 'dif':53 'dsoprea':11 'execut':63 'export':48 'februari':82 'get':43 'info':44 'instal':67 'interfac':35 'intuit':14 'last':79 'librari':9,55 'lightweight':34 'line':4,23,62,93 'list':42 'log':45 'must':65 'oper':39 'provid':32 'python':15,27 'releas':80 'separ':68 'subvers':1,19,85 'svn':6,8,20,38,59,84 'system':71 'updat':51 'vcs':86 'version':74,88 'version-control':87 'wrap':57 'wrapper':5,16,90","created_at":"2026-04-16T17:03:30.470714+00:00","updated_at":"2026-04-16T17:03:30.470714+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.0.1","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/dsoprea/PySvn","docs":null,"changelog":null,"pypi":"https://pypi.org/project/svn/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","http-networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-30","last_verified":"2026-06-30","next_check":"2026-07-30","install_tag":null}}