{"id":25410111,"url":"https://github.com/msztolcman/fileperms","last_synced_at":"2025-10-31T04:32:01.612Z","repository":{"id":57429413,"uuid":"49346310","full_name":"msztolcman/fileperms","owner":"msztolcman","description":"fileperms is small library for Python for describing file permissions","archived":false,"fork":false,"pushed_at":"2024-02-18T16:14:20.000Z","size":114,"stargazers_count":2,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-15T04:46:41.764Z","etag":null,"topics":["chmod","filesystem","permission","permissions","perms"],"latest_commit_sha":null,"homepage":"https://github.com/msztolcman/fileperms","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msztolcman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-09T23:48:18.000Z","updated_at":"2024-02-18T16:15:12.000Z","dependencies_parsed_at":"2022-08-27T16:50:40.857Z","dependency_job_id":null,"html_url":"https://github.com/msztolcman/fileperms","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msztolcman%2Ffileperms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msztolcman%2Ffileperms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msztolcman%2Ffileperms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msztolcman%2Ffileperms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msztolcman","download_url":"https://codeload.github.com/msztolcman/fileperms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239114257,"owners_count":19583985,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chmod","filesystem","permission","permissions","perms"],"created_at":"2025-02-16T09:30:18.809Z","updated_at":"2025-10-31T04:32:01.246Z","avatar_url":"https://github.com/msztolcman.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"fileperms\n==========\n\n`fileperms` helps you read, change and set file permissions\n\nCurrent stable version\n----------------------\n\n1.2.0\n\nFeatures\n--------\n\n* easy manipulating of file permissions\n* works fine with `os.chmod` and `pathlib.Path`\n\nPython version\n--------------\n\n`fileperms` works only with Python 3.7+. Older Python versions are supported with older package versions.\n\nSome examples\n-------------\n\n    # Some helper\n    \u003e\u003e\u003e def show_permissions(path):\n    \u003e\u003e\u003e     print(stat.filemode(os.stat(path).st_mode))\n    \u003e\u003e\u003e\n\n    # Create Permissions object from existing file:\n    \u003e\u003e\u003e import fileperms\n    \u003e\u003e\u003e fileperms.Permissions.from_path('/etc')\n    \u003cPermissions(0755)\u003e\n\n    # Or shorter:\n    \u003e\u003e\u003e fileperms.from_path('/etc')\n    \u003cPermissions(0755)\u003e\n\n    # We are working on object with permissions 0600 / rw-------\n    \u003e\u003e\u003e import os, stat\n    \u003e\u003e\u003e show_permissions(path)\n    -rw-------\n\n    # Verify that\n    \u003e\u003e\u003e prm = fileperms.from_path(path)\n    \u003e\u003e\u003e prm\n    \u003cPermissions(0600)\u003e\n    \u003e\u003e\u003e prm.to_filemode()\n    'rw-------'\n\n    # Change them a little using os.chmod\n    \u003e\u003e\u003e prm.owner_exec = True\n    # or using setter:\n    \u003e\u003e\u003e prm.set(fileperms.Permission.other_exec, True)\n    \u003e\u003e\u003e os.chmod(path, int(prm))\n    \u003e\u003e\u003e show_permissions(path)\n    -rwx-----x\n\n    # Change them more, using pathlib module this time\n    \u003e\u003e\u003e import pathlib\n    \u003e\u003e\u003e path = pathlib.Path(path)\n    \u003e\u003e\u003e prm.group_read = True\n    \u003e\u003e\u003e prm.group_write = True\n    \u003e\u003e\u003e path.chmod(int(prm))\n    \u003e\u003e\u003e show_permissions(path)\n    -rwxrw---x\n\n    # You can also use Permissions.apply method for\n    # applying same permissions to other objects:\n    \u003e\u003e\u003e prm.other_read = True\n    \u003e\u003e\u003e prm.apply(path)\n    \u003e\u003e\u003e show_permissions(path)\n    -rwxrwxr-x\n\nInstallation\n------------\n\n1. Using PIP\n\n`fileperms` should work on any platform where [Python](http://python.org)\nis available, it means Linux, Windows, MacOS X etc, but is not tested on Windows.\n\nSimplest way is to use Python's built-in package system:\n\n    python -m pip install fileperms\n\n2. Using sources\n\nDownload sources from [Github](https://github.com/msztolcman/fileperms/archive/1.2.0.zip):\n\n    wget -O 1.2.0.zip https://github.com/msztolcman/fileperms/archive/1.2.0.zip\n\nor\n\n    curl -o 1.2.0.zip https://github.com/msztolcman/fileperms/archive/1.2.0.zip\n\nUnpack:\n\n    unzip 1.2.0.zip\n\nAnd install\n\n    cd fileperms-1.2.0\n    python setup.py install\n\nVoila!\n\nAuthors\n-------\n\nMarcin Sztolcman \u003cmarcin@urzenia.net\u003e\n\nContact\n-------\n\nIf you like or dislike this software, please do not hesitate to tell me about\nthis me via email (marcin@urzenia.net).\n\nIf you find bug or have an idea to enhance this tool, please use GitHub's\n[issues](https://github.com/msztolcman/fileperms/issues).\n\nLicense\n-------\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Marcin Sztolcman\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nChangeLog\n---------\n\n### v1.2.0\n* added `Permissions.apply` method for applying permissions (instead\n  of `os.chmod` of `path.chmod`)\n* `Permissions.from_path` defines `path` as `pathlib.Path`, but *any* object with `stat` or\n  `lstat` method will work ([protocols](https://docs.python.org/3/library/typing.html#typing.Protocol)\n  are from Python 3.8 unfortunatelly)\n* rewritten internal package configuration to from `setup.py`\n  to `setup.cfg`\n* improved descriptions, README etc\n\n### v1.1.1\n* fixed tests\n* minor testing suite reconfig\n* updates setup.py\n\n### v1.1.0\n\n* changed minimum Python version to 3.7+\n* `os.lchmod`, `os.chmod`, `pathlib.Path.lchmod`, `pathlib.Path.chmod`\n  requires explicit casting to int now :(\n* changed from requirements* files to `Pipenv`\n* rewrite README from .rst to .md\n* cleanups\n\n### v1.0.4\n\n* updated README.rst\n\n### v1.0.3\n\n* improved documentation\n* Permissions.set method now returns self\n\n### v1.0.2\n\n* not important\n\n### v1.0.1\n\n* documentation and pylint\n* dev packages upgraded\n\n### v1.0.0\n\n* first public version\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsztolcman%2Ffileperms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsztolcman%2Ffileperms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsztolcman%2Ffileperms/lists"}