Skip to main content

Intuitive Subversion wrapper.

Project description

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
import pprint

r = svn.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

r = svn.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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

svn-0.3.17.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

svn-0.3.17-py2-none-any.whl (11.6 kB view details)

Uploaded Python 2

File details

Details for the file svn-0.3.17.tar.gz.

File metadata

  • Download URL: svn-0.3.17.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for svn-0.3.17.tar.gz
Algorithm Hash digest
SHA256 6864f1ffe634ea7f068692474cf3f2b1c27c433a7e5c93f284d5d5fe93a7470b
MD5 bd792a4806c2cba7113538e7f60e2c6c
BLAKE2b-256 18dd6862a9264b64fad106a6806078cf2ebebc4cd31be31e23e2d3f58f5e9cae

See more details on using hashes here.

File details

Details for the file svn-0.3.17-py2-none-any.whl.

File metadata

File hashes

Hashes for svn-0.3.17-py2-none-any.whl
Algorithm Hash digest
SHA256 0868b59b6d80c08660c3d93f7c299a0702eda6f49469eb7b0b1be162c960f50b
MD5 aac01742e7b45a6488b5378a936f5250
BLAKE2b-256 30bbba23e466adf0fb3b8b9df13ecf1afca236f55398bcca333a2e6ad73a138c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page