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.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.

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.20.tar.gz (4.6 kB view details)

Uploaded Source

Built Distributions

svn-0.3.20-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

svn-0.3.20-py2-none-any.whl (12.2 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for svn-0.3.20.tar.gz
Algorithm Hash digest
SHA256 a04665654440fa518e8717ea719adfa005d88af46842d8d7b08620a242f89d69
MD5 22113d7e6ad9136af1ad01718a8a4aaa
BLAKE2b-256 0ef7bdf4cfc187985b27212ca13066d0a4077ee5e7f6969cb4f8c6678bd35f06

See more details on using hashes here.

File details

Details for the file svn-0.3.20-py3-none-any.whl.

File metadata

File hashes

Hashes for svn-0.3.20-py3-none-any.whl
Algorithm Hash digest
SHA256 a162c2f1cc67a62a37c8755e61a6c9a8f5ac34be4057d1dc1a8c0f42988eecdd
MD5 f38694d037ce4b5d9d7a101c86ae315c
BLAKE2b-256 77a13579852af7de033b79a1fd7c3867601d2f4670af74284ad31805b47aa774

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for svn-0.3.20-py2-none-any.whl
Algorithm Hash digest
SHA256 13a79ef176244718051e82db7b304033b5fe20ae88523ec270634d1fe9ebad1c
MD5 e5a2b9a5d162c04f99315fd4fc773d83
BLAKE2b-256 f8db45ffc9e3b55c1226cc6fe5f71aa2a41b99df79e221fbfec70289a7369981

See more details on using hashes here.

Supported by

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