{"id":38079102,"url":"https://github.com/matfax/mutapath","last_synced_at":"2026-01-16T20:47:02.935Z","repository":{"id":35163636,"uuid":"214673790","full_name":"matfax/mutapath","owner":"matfax","description":"mutable pathlib for Python","archived":false,"fork":false,"pushed_at":"2025-12-31T09:01:32.000Z","size":425,"stargazers_count":3,"open_issues_count":20,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-04T13:00:03.385Z","etag":null,"topics":["extension","mutable","path","pathlib","python"],"latest_commit_sha":null,"homepage":"https://mutapath.fax.fyi","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matfax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-10-12T15:53:09.000Z","updated_at":"2025-10-15T05:29:58.000Z","dependencies_parsed_at":"2024-10-24T02:22:28.681Z","dependency_job_id":"e82fe088-d7d5-4f51-a6ea-0e90dcb55d47","html_url":"https://github.com/matfax/mutapath","commit_stats":{"total_commits":198,"total_committers":6,"mean_commits":33.0,"dds":0.202020202020202,"last_synced_commit":"a3c6e59684aab847e9b8ae968b9d31c0a0deb0c0"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/matfax/mutapath","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matfax%2Fmutapath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matfax%2Fmutapath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matfax%2Fmutapath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matfax%2Fmutapath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matfax","download_url":"https://codeload.github.com/matfax/mutapath/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matfax%2Fmutapath/sbom","scorecard":{"id":623926,"data":{"date":"2025-08-11","repo":{"name":"github.com/matfax/mutapath","commit":"77dba04cd89127d675c32ec5e9bb206c7461af90"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/advisor.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/matfax/mutapath/advisor.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/audit.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/matfax/mutapath/audit.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/audit.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/matfax/mutapath/audit.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/audit.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/matfax/mutapath/audit.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/audit.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/matfax/mutapath/audit.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/audit.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/matfax/mutapath/audit.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/black.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/matfax/mutapath/black.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/black.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/matfax/mutapath/black.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/black.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/matfax/mutapath/black.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/black.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/matfax/mutapath/black.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/black.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/matfax/mutapath/black.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/matfax/mutapath/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/matfax/mutapath/build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/matfax/mutapath/build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/matfax/mutapath/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/matfax/mutapath/codeql.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/matfax/mutapath/codeql.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/matfax/mutapath/codeql.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/matfax/mutapath/codeql.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/matfax/mutapath/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/matfax/mutapath/publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/matfax/mutapath/publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/matfax/mutapath/publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/matfax/mutapath/publish.yml/main?enable=pin","Info:   0 out of  12 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of  12 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":7,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: jobLevel 'contents' permission set to 'write': .github/workflows/black.yml:18","Info: found token with 'none' permissions: .github/workflows/build.yml:18","Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql.yml:23","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql.yml:24","Info: jobLevel 'contents' permission set to 'read': .github/workflows/publish.yml:13","Info: topLevel 'actions' permission set to 'read': .github/workflows/advisor.yml:4","Warn: no topLevel permission defined: .github/workflows/audit.yml:1","Warn: no topLevel permission defined: .github/workflows/black.yml:1","Warn: no topLevel permission defined: .github/workflows/build.yml:1","Warn: no topLevel permission defined: .github/workflows/codeql.yml:1","Warn: no topLevel permission defined: .github/workflows/publish.yml:1"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU Lesser General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":3,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'main'","Info: 'force pushes' disabled on branch 'main'","Info: 'branch protection settings apply to administrators' is required to merge on branch 'main'","Warn: branch 'main' does not require approvers","Warn: codeowners review is not required on branch 'main'","Warn: no status checks found to merge onto branch 'main'","Warn: PRs are not required to make changes on branch 'main'; or we don't have data to detect it.If you think it might be the latter, make sure to run Scorecard with a PAT or use Repo Rules (that are always public) instead of Branch Protection settings"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"20 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6","Warn: Project is vulnerable to: PYSEC-2024-230 / GHSA-248v-346w-9cwc","Warn: Project is vulnerable to: PYSEC-2023-135 / GHSA-xqr8-7jwr-rhp7","Warn: Project is vulnerable to: PYSEC-2024-4 / GHSA-2mqj-m65w-jghx","Warn: Project is vulnerable to: PYSEC-2023-165 / GHSA-cwvm-v4w8-q58c","Warn: Project is vulnerable to: PYSEC-2023-137 / GHSA-pr76-5cm5-w9cj","Warn: Project is vulnerable to: PYSEC-2023-161 / GHSA-wfm5-v35h-vwf4","Warn: Project is vulnerable to: PYSEC-2024-60 / GHSA-jjg7-2v4v-x38h","Warn: Project is vulnerable to: GHSA-cpwx-vrp4-4pq7","Warn: Project is vulnerable to: GHSA-gmj6-6f8f-6699","Warn: Project is vulnerable to: GHSA-h5c8-rqwp-cp95","Warn: Project is vulnerable to: GHSA-h75v-3vvj-5mfj","Warn: Project is vulnerable to: GHSA-q2x7-8rv6-6q7h","Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-9wx4-h78v-vm56","Warn: Project is vulnerable to: GHSA-34jh-p97f-mpxf","Warn: Project is vulnerable to: PYSEC-2023-212 / GHSA-g4mx-q9vg-27p4","Warn: Project is vulnerable to: GHSA-pq67-6m6q-mj2v","Warn: Project is vulnerable to: PYSEC-2023-192 / GHSA-v845-jxx5-vc9f","Warn: Project is vulnerable to: GHSA-jfmj-5v4g-7637"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T05:54:13.068Z","repository_id":35163636,"created_at":"2025-08-21T05:54:13.068Z","updated_at":"2025-08-21T05:54:13.068Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28482310,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["extension","mutable","path","pathlib","python"],"created_at":"2026-01-16T20:47:02.113Z","updated_at":"2026-01-16T20:47:02.934Z","avatar_url":"https://github.com/matfax.png","language":"Python","readme":"# mutapath\n\n[![GitHub Workflow Status (with branch)](https://img.shields.io/github/actions/workflow/status/matfax/mutapath/build.yml?branch=main\u0026style=for-the-badge)](https://github.com/matfax/mutapath/actions)\n[![Codecov](https://img.shields.io/codecov/c/github/matfax/mutapath?style=for-the-badge)](https://codecov.io/gh/matfax/mutapath)\n[![Documentation Status](https://readthedocs.org/projects/mutapath/badge/?version=latest\u0026style=for-the-badge)](https://mutapath.readthedocs.io/en/latest/?badge=latest)\n[![Renovate Bot](https://img.shields.io/badge/renovate-enabled-green?style=for-the-badge\u0026logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjUgNSAzNzAgMzcwIj48Y2lyY2xlIGN4PSIxODkiIGN5PSIxOTAiIHI9IjE4NCIgZmlsbD0iI2ZlMiIvPjxwYXRoIGZpbGw9IiM4YmIiIGQ9Ik0yNTEgMjU2bC0zOC0zOGExNyAxNyAwIDAxMC0yNGw1Ni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4Yy00IDAtOC0yLTExLTVsLTIzLTIzYTE2IDE2IDAgMDEwLTIzTDIwMSA5NmExNiAxNiAwIDAxMjIgMGwyNCAyNGM2IDYgNiAxNiAwIDIyTDE0NiAyNDNjLTMgMy03IDUtMTIgNXptNzgtMTQ3bC00IDItMTAxIDEwMWE2IDYgMCAwMDAgOWwyMyAyM2E2IDYgMCAwMDkgMGwxMDEtMTAxYTYgNiAwIDAwMC05bC0yNC0yMy00LTJ6Ii8+PC9zdmc+)](https://github.com/matfax/mutapath/issues/270)\n[![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/pypi/mutapath?style=for-the-badge)](https://libraries.io/pypi/mutapath)\n[![CodeFactor](https://www.codefactor.io/repository/github/matfax/mutapath/badge?style=for-the-badge)](https://www.codefactor.io/repository/github/matfax/mutapath)\n[![security: bandit](https://img.shields.io/badge/security-bandit-purple.svg?style=for-the-badge)](https://github.com/PyCQA/bandit)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge)](https://github.com/psf/black)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/mutapath?style=for-the-badge)](https://pypi.org/project/mutapath/)\n[![PyPI](https://img.shields.io/pypi/v/mutapath?color=%2339A7A6\u0026style=for-the-badge)](https://pypi.org/project/mutapath/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/mutapath?color=ff69b4\u0026style=for-the-badge)](https://pypistats.org/packages/mutapath)\n[![GitHub Release Date](https://img.shields.io/github/release-date/matfax/mutapath?color=%23986293\u0026style=for-the-badge)](https://github.com/matfax/mutapath/releases)\n[![GitHub last commit](https://img.shields.io/github/last-commit/matfax/mutapath?color=9cf\u0026style=for-the-badge)](https://github.com/matfax/mutapath/commits/main)\n[![GitHub License](https://img.shields.io/github/license/matfax/mutapath.svg?style=for-the-badge)](https://github.com/matfax/mutapath/blob/main/LICENSE)\n\nThis library is for you if you are also annoyed that there is no mutable pathlib wrapper for use cases in which paths are often changed.\nmutapath solves this by wrapping both, the Python 3 pathlib library, and the alternate  [path library](https://pypi.org/project/path/), and providing a mutable context manager for them.\n\n## MutaPath Class\n\nThe MutaPath Class allows direct mutation of its attributes at any time, just as any mutable object.\nOnce a file operation is called that is intended to modify its path, the underlying path is also mutated.\n\n```python\n\u003e\u003e\u003e from mutapath import MutaPath\n```\n```python\n\u003e\u003e\u003e folder = MutaPath(\"/home/joe/doe/folder/sub\")\n\u003e\u003e\u003e folder\nPath('/home/joe/doe/folder/sub')\n```\n```python\n\u003e\u003e\u003e folder.name = \"top\"\n\u003e\u003e\u003e folder\nPath('/home/joe/doe/folder/top')\n```\n```python\n\u003e\u003e\u003e next = MutaPath(\"/home/joe/doe/folder/next\")\n\u003e\u003e\u003e next\nPath('/home/joe/doe/folder/next')\n```\n```python\n\u003e\u003e\u003e next.rename(folder)\n\u003e\u003e\u003e next\nPath('/home/joe/doe/folder/top')\n\u003e\u003e\u003e next.exists()\nTrue\n\u003e\u003e\u003e Path('/home/joe/doe/folder/sub').exists()\nFalse\n```\n\n## Path Class\n\nThis class is immutable by default, just as the `pathlib.Path`. However, it allows to open a editing context via `mutate()`.\nMoreover, there are additional contexts for file operations. They update the file and its path while closing the context.\nIf the file operations don't succeed, they throw an exception and fall back to the original path value.\n\n```python\n\u003e\u003e\u003e from mutapath import Path\n```\n```python\n\u003e\u003e\u003e folder = Path(\"/home/joe/doe/folder/sub\")\n\u003e\u003e\u003e folder\nPath('/home/joe/doe/folder/sub')\n```\n```python\n\u003e\u003e\u003e folder.name = \"top\"\nAttributeError: mutapath.Path is an immutable class, unless mutate() context is used.\n\u003e\u003e\u003e folder\nPath('/home/joe/doe/folder/sub')\n```\n```python\n\u003e\u003e\u003e with folder.mutate() as m:\n...     m.name = \"top\"\n\u003e\u003e\u003e folder\nPath('/home/joe/doe/folder/top')\n```\n```python\n\u003e\u003e\u003e next = Path(\"/home/joe/doe/folder/next\")\n\u003e\u003e\u003e next.copy(folder)\n\u003e\u003e\u003e next\nPath('/home/joe/doe/folder/next')\n\u003e\u003e\u003e folder.exists()\nTrue\n\u003e\u003e\u003e folder.remove()\n```\n```python\n\u003e\u003e\u003e with next.renaming() as m:\n...     m.stem = folder.stem\n...     m.suffix = \".txt\"\n\u003e\u003e\u003e next\nPath(\"/home/joe/doe/folder/sub.txt\")\n\u003e\u003e\u003e next.exists()\nTrue\n\u003e\u003e\u003e next.with_name(\"next\").exists()\nFalse\n```\n\nFor more in-depth examples, check the tests folder.\n\n## Locks\n\nSoft Locks can easily be accessed via the lazy lock property.\nMoreover, the mutable context managers in `Path` (i.e., `renaming`, `moving`, `copying`) allow implicit locking.\nThe lock object is cached as long as the file is not mutated. \nOnce the lock is mutated, it is released and regenerated, respecting the new file name.\n\n```python\n\u003e\u003e\u003e my_path = Path('/home/doe/folder/sub')\n\u003e\u003e\u003e with my_path.lock:\n...     my_path.write_text(\"I can write\")\n```\n\n## Hashing\n\nmutapath paths are hashable by caching the generated hash the first time it is accessed.\nHowever, it also adds a warning so that unintended hash usage is avoided.\nOnce mutated after that, the generated hashes don't provide collision detection in binary trees anymore.\nDon't use them in sets or as keys in dicts.\nUse the explicit string representation instead, to make the hashing input transparent.\n\n```python\n\u003e\u003e\u003e p = Path(\"/home\")\n\u003e\u003e\u003e hash(p)\n1083235232\n\u003e\u003e\u003e hash(Path(\"/home\")) == hash(p)\nTrue\n\u003e\u003e\u003e with p.mutate() as m:\n...     m.name = \"home4\"\n\u003e\u003e\u003e hash(p) # same hash\n1083235232\n\u003e\u003e\u003e hash(Path(\"/home\")) == hash(p) # they are not equal anymore\nTrue\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatfax%2Fmutapath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatfax%2Fmutapath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatfax%2Fmutapath/lists"}