PyQuota

Python wrapper for the Linux quotactl(2) APIs.

Requirements

  • Linux with kernel quota support (CONFIG_QUOTA)

  • Root or CAP_SYS_ADMIN

  • Kernel >= 2.4.22; project quota >= 4.1; Q_GETNEXTQUOTA >= 4.6

Installation

pip install pyquota

Quick start

import pyquota as pq

pq.user_quota_on("/dev/sda1", pq.QuotaFormat.VFS_V0, "/aquota.user")
q = pq.get_user_quota("/dev/sda1", 1000)
print(q.block_hard_limit, q.block_current)

API Reference

Errors

All quotactl failures are raised as pyquota.APIError with messages matching the quotactl(2) ERRORS section.