A simple, cross-platform, lightweight utility to check permission of files and folders in Python.
Project description
Permission Check
A simple, cross-platform, lightweight utility to check permission of files and folders in Python.
Usage
pip install permission-check
from permission_check.permission_check import PermissionCheck
file = PermissionCheck(path="path_to_your_file")
(AFileNotFoundError
will occur if the path is not an existing file or folder on the file system)
For checking Owner Permissions
Read
if file.owner.has_read():
print("Owner has read permissions"")
Write
if file.owner.has_write():
print("Owner has write permissions"")
Execute
if file.owner.has_execute():
print("Owner has execute permissions"")
For checking Group and Others user's Permissions
For checking Group and Other user's permissions just to file.group
and file.others
respectively. followed by the .has_all()
or .has_read()
or .has_write()
or .has_execute()
methods
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
permission_check-0.0.2.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for permission_check-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d21036dec69d3297181102a0c069bbc0d58d7f274d01bae04512fd429d50bab |
|
MD5 | 9f6db71b8585260a142709252d6936d7 |
|
BLAKE2b-256 | 35c1bc920ec6306ee203eefeb0093fab7b814abe05def287c2ed33976a208080 |