Permissions
Permissions provides a tiny wrapper on top of built-in Python's libraries
to get information about file permissions in Unix systems.
Motivation
Currently everything related to permission management is spreaded across few packages.
It is nice and handy to have everything gathered together. Permissions is quite incomplete
at the moment and any kind of missed functionality is welcome as pull requests or GitHub issues.
Installation
pip install file-permissions
Example
from permissions import get_permissions_from
p = get_permissions_from('test.txt') # returns PermissionsContainer object
p.executable()
# False
p.readable()
# True
Reference
Available fields in PermissionsContainer:
- executable - boolean, indicates whether file could be executed by current user or not;
- group - object(pwd.struct_group), contains information about group the file belongs to. Available fields there are:
- gr_name
- gr_passwd
- gr_gid
- gr_mem
- is_sticky - boolean, inficates whether file has sticky bit or not.
- owner - object(pwd.struct_passwd), contains information about user the file belongs to. Available fields there are:
- pw_name
- pw_passwd
- pw_uid
- pw_gid
- pw_gecos
- pw_dir
- pw_shell
- readable - boolean, indicates whether file could be read by current user or not;
- sgid - returns SGID if set or 0;
- suid - returns SUID if set or 0;
- umask - str, file permissions as umask, e. g. 0755, 0400;
- writable - boolean, indicates whether file could be written by current user or not;
Metadata
Release files for file-permissions 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| file_permissions-0.2-py2-none-any.whl | Python 2 | none | any | Details for file_permissions-0.2-py2-none-any.whl |
Release files / file_permissions-0.2-py2-none-any.whl
| Download URL | file_permissions-0.2-py2-none-any.whl |
|---|---|
| Size | 2.6 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
95236d8a12a40b4dc8739f24efaee8cd1491c43b1fcacdd214f5b29fa986db55
|
|
BLAKE2b-256 checksum How to use checksums |
4caaa86de98bcca1e1336de41e6f96cf0de04547df806a7edbf44dd3785253cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.11.1 setuptools/20.7.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.12
|
Security for file-permissions 0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.