Skip to main content

Introduction

svn is a simple Subversion library for Python. I wrote it so that there could be a lightweight and accessible library that was also available on PyPI. It is compatible with both Python 2.7 and 3.3+.

I’ve only implemented the functionality that I have required:

  • Listing entries

  • Getting info

  • Getting log

  • Checking-out

  • Exporting

You are more than welcome to submit pull-requests to add more support for additional subcommands.

Usage

Usage is divided between two clients that either allow for access to a local working-directory or a remote repository.

Both clients inherit a common set of methods that work with both local working-directories and remote repositories.

LocalClient

LocalClient allows access to a local working copy.

Example LocalClient usage:

import svn.local
import pprint

r = svn.local.LocalClient('/dev/repo')
r.export('/tmp/export')

pprint.pprint(r.info())

Output:

{'commit#revision': 0,
 'commit/author': None,
 'commit/date': datetime.datetime(2014, 4, 1, 5, 50, 27, 826988, tzinfo=tzutc()),
 'entry#kind': 'dir',
 'entry#path': 'working_copy',
 'entry#revision': 0,
 'relative_url': '^/',
 'repository/root': 'file:///svn/test/repo',
 'repository/uuid': '48195b71-8d94-4528-a019-ec81ebc7e65a',
 'url': 'file:///svn/test/repo',
 'wc-info/depth': 'infinity',
 'wc-info/schedule': 'normal',
 'wc-info/wcroot-abspath': '/svn/dev/working_copy'}

RemoteClient

RemoteClient allows access to a remote repository.

  • checkout(path)

Example RemoteClient usage:

import svn.remote

r = svn.remote.RemoteClient('https://repo.local/svn')
r.checkout('/tmp/working')

Common Functionality

These methods are available on both clients.

  • info()

  • export(path)

  • cat(rel_filepath)

  • log_default(timestamp_from_dt=None, timestamp_to_dt=None, limit=None)

Important

Previously, the LocalClient and RemoteClient classes were exposed at the package level:

  • svn.LocalClient

  • svn.RemoteClient

Unfortunately, this interfered with dependency management during installation. The imports will now have to be, respectively:

  • svn.local (for LocalClient)

  • svn.remote (for RemoteClient)

We’re sorry for the inconvenience.

Release files for svn 0.3.21

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for svn 0.3.21
File Size Uploaded
svn-0.3.21.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for svn 0.3.21
File Interpreter ABI Platform
svn-0.3.21-py2-none-any.whl Python 2 none any Details

Total release size: 17.2 kB

Release files / svn-0.3.21.tar.gz

Download URL svn-0.3.21.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
327242c1be88a0688ae7547d14a046c792387362ead871e173d8b40b71c2b6ca
BLAKE2b-256 checksum
How to use checksums
e797ffb5ed4a8032bfcddccbc49d6607f545cec692c1f9d1d08776cd82129f5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / svn-0.3.21-py2-none-any.whl

Download URL svn-0.3.21-py2-none-any.whl
Size 12.4 kB
Tags Python 2
SHA-256 checksum
How to use checksums
b14bbe0642a1dfc83ca57053ade065f3695af20316506738a916483952edc35b
BLAKE2b-256 checksum
How to use checksums
d2c053eb19c1ebe71c06c90fead66bdf271d8058a0689c97d18aa92a6e3da94a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

1.0.1

1 release file

1.0.0

1 release file

0.3.46

1 release file

0.3.45

1 release file

0.3.43

2 release files

0.3.42

2 release files

0.3.41

2 release files

0.3.40

2 release files

0.3.37

0.3.36

2 release files

0.3.35

2 release files

0.3.34

2 release files

0.3.33

2 release files

0.3.32

1 release file

0.3.31

1 release file

0.3.30

1 release file

0.3.29

1 release file

0.3.28

1 release file

0.3.27

1 release file

0.3.24

2 release files

0.3.23

1 release file

0.3.22

1 release file

This release

0.3.21 This release

2 release files

0.3.18

2 release files

0.3.17

2 release files

0.3.16

2 release files

0.3.15

2 release files

0.3.14

1 release file

0.3.13

1 release file

0.3.12

1 release file

0.3.11

1 release file

0.3.10

1 release file

0.3.7

1 release file

0.3.6

1 release file

0.3.5

1 release file

0.3.4

1 release file

0.3.3

0.1.0dev

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page