Skip to main content

A Python API for ZFS

Project description

Weir is a Python API for ZFS.

The API is loosely based on libzfs, but is intended to be more Pythonic rather than reproducing the C API exactly. Key differences include:

  • ZFS datasets are represented as objects.
  • send() and receive() return open files.

Weir is implemented on top of the command-line zfs and zpool commands for portability and so as to facilitate support for remote operation without requiring installation on the remote host.

Remote datasets can be specified with urls of the form zfs://user@host/path@snapname.

Installation

Requires Python 2.6, 2.7 or 3.4+.

To install Weir, simply:

$ pip install weir

Usage

eg to find a filesystem’s most recent snapshot:

>>> from weir import zfs
>>> zfs.open('zfs://backup.local/wanaka/test').snapshots()[-1].name
'zfs://backup.local/wanaka/test@auto-2015-04-08T145240'

License

Licensed under the Common Development and Distribution License (CDDL).

Project details


Download files

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

Files for weir, version 0.4.0
Filename, size & hash File type Python version Upload date
weir-0.4.0.tar.gz (5.2 kB) View hashes Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page