mutapath


Namemutapath JSON
Version 0.17.1 PyPI version JSON
download
home_pagehttps://mutapath.fax.fyi
Summarymutable pathlib
upload_time2023-07-13 14:19:59
maintainer
docs_urlNone
authormatfax
requires_python>=3.8,<4.0
licenseLGPL-3.0
keywords pathlib mutable path
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # mutapath

[![GitHub Workflow Status (with branch)](https://img.shields.io/github/actions/workflow/status/matfax/mutapath/build.yml?branch=main&style=for-the-badge)](https://github.com/matfax/mutapath/actions)
[![Codecov](https://img.shields.io/codecov/c/github/matfax/mutapath?style=for-the-badge)](https://codecov.io/gh/matfax/mutapath)
[![Documentation Status](https://readthedocs.org/projects/mutapath/badge/?version=latest&style=for-the-badge)](https://mutapath.readthedocs.io/en/latest/?badge=latest)
[![Renovate Bot](https://img.shields.io/badge/renovate-enabled-green?style=for-the-badge&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjUgNSAzNzAgMzcwIj48Y2lyY2xlIGN4PSIxODkiIGN5PSIxOTAiIHI9IjE4NCIgZmlsbD0iI2ZlMiIvPjxwYXRoIGZpbGw9IiM4YmIiIGQ9Ik0yNTEgMjU2bC0zOC0zOGExNyAxNyAwIDAxMC0yNGw1Ni01NmMyLTIgMi02IDAtN2wtMjAtMjFhNSA1IDAgMDAtNyAwbC0xMyAxMi05LTggMTMtMTNhMTcgMTcgMCAwMTI0IDBsMjEgMjFjNyA3IDcgMTcgMCAyNGwtNTYgNTdhNSA1IDAgMDAwIDdsMzggMzh6Ii8+PHBhdGggZmlsbD0iI2Q1MSIgZD0iTTMwMCAyODhsLTggOGMtNCA0LTExIDQtMTYgMGwtNDYtNDZjLTUtNS01LTEyIDAtMTZsOC04YzQtNCAxMS00IDE1IDBsNDcgNDdjNCA0IDQgMTEgMCAxNXoiLz48cGF0aCBmaWxsPSIjYjMwIiBkPSJNMjg1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4em0tODkgOTBsMTgtMTggMTggMTgtMTggMTh6bTEzOS04NWwyMyAyM2M0IDQgNCAxMSAwIDE2TDE0MiAyNDBjLTQgNC0xMSA0LTE1IDBsLTI0LTI0Yy00LTQtNC0xMSAwLTE1bDEwMS0xMDFjNS01IDEyLTUgMTYgMHoiLz48cGF0aCBmaWxsPSIjM2VlIiBkPSJNMTM0IDk1bDE4LTE4IDE4IDE4LTE4IDE4em0tNTQgMThsMTgtMTcgMTggMTctMTggMTh6bTU1LTUzbDE4LTE4IDE4IDE4LTE4IDE4em05MyA0OGwtOC04Yy00LTUtMTEtNS0xNiAwTDEwMyAyMDFjLTQgNC00IDExIDAgMTVsOCA4Yy00LTQtNC0xMSAwLTE1bDEwMS0xMDFjNS00IDEyLTQgMTYgMHoiLz48cGF0aCBmaWxsPSIjOWVlIiBkPSJNMjcgMTMxbDE4LTE4IDE4IDE4LTE4IDE4em01NC01M2wxOC0xOCAxOCAxOC0xOCAxOHoiLz48cGF0aCBmaWxsPSIjMGFhIiBkPSJNMjMwIDExMGwxMyAxM2M0IDQgNCAxMSAwIDE2TDE0MiAyNDBjLTQgNC0xMSA0LTE1IDBsLTEzLTEzYzQgNCAxMSA0IDE1IDBsMTAxLTEwMWM1LTUgNS0xMSAwLTE2eiIvPjxwYXRoIGZpbGw9IiMxYWIiIGQ9Ik0xMzQgMjQ4Yy00IDAtOC0yLTExLTVsLTIzLTIzYTE2IDE2IDAgMDEwLTIzTDIwMSA5NmExNiAxNiAwIDAxMjIgMGwyNCAyNGM2IDYgNiAxNiAwIDIyTDE0NiAyNDNjLTMgMy03IDUtMTIgNXptNzgtMTQ3bC00IDItMTAxIDEwMWE2IDYgMCAwMDAgOWwyMyAyM2E2IDYgMCAwMDkgMGwxMDEtMTAxYTYgNiAwIDAwMC05bC0yNC0yMy00LTJ6Ii8+PC9zdmc+)](https://github.com/matfax/mutapath/issues/270)
[![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/pypi/mutapath?style=for-the-badge)](https://libraries.io/pypi/mutapath)
[![CodeFactor](https://www.codefactor.io/repository/github/matfax/mutapath/badge?style=for-the-badge)](https://www.codefactor.io/repository/github/matfax/mutapath)
[![security: bandit](https://img.shields.io/badge/security-bandit-purple.svg?style=for-the-badge)](https://github.com/PyCQA/bandit)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge)](https://github.com/psf/black)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/mutapath?style=for-the-badge)](https://pypi.org/project/mutapath/)
[![PyPI](https://img.shields.io/pypi/v/mutapath?color=%2339A7A6&style=for-the-badge)](https://pypi.org/project/mutapath/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/mutapath?color=ff69b4&style=for-the-badge)](https://pypistats.org/packages/mutapath)
[![GitHub Release Date](https://img.shields.io/github/release-date/matfax/mutapath?color=%23986293&style=for-the-badge)](https://github.com/matfax/mutapath/releases)
[![GitHub last commit](https://img.shields.io/github/last-commit/matfax/mutapath?color=9cf&style=for-the-badge)](https://github.com/matfax/mutapath/commits/main)
[![GitHub License](https://img.shields.io/github/license/matfax/mutapath.svg?style=for-the-badge)](https://github.com/matfax/mutapath/blob/main/LICENSE)

This 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.
mutapath 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.

## MutaPath Class

The MutaPath Class allows direct mutation of its attributes at any time, just as any mutable object.
Once a file operation is called that is intended to modify its path, the underlying path is also mutated.

```python
>>> from mutapath import MutaPath
```
```python
>>> folder = MutaPath("/home/joe/doe/folder/sub")
>>> folder
Path('/home/joe/doe/folder/sub')
```
```python
>>> folder.name = "top"
>>> folder
Path('/home/joe/doe/folder/top')
```
```python
>>> next = MutaPath("/home/joe/doe/folder/next")
>>> next
Path('/home/joe/doe/folder/next')
```
```python
>>> next.rename(folder)
>>> next
Path('/home/joe/doe/folder/top')
>>> next.exists()
True
>>> Path('/home/joe/doe/folder/sub').exists()
False
```

## Path Class

This class is immutable by default, just as the `pathlib.Path`. However, it allows to open a editing context via `mutate()`.
Moreover, there are additional contexts for file operations. They update the file and its path while closing the context.
If the file operations don't succeed, they throw an exception and fall back to the original path value.

```python
>>> from mutapath import Path
```
```python
>>> folder = Path("/home/joe/doe/folder/sub")
>>> folder
Path('/home/joe/doe/folder/sub')
```
```python
>>> folder.name = "top"
AttributeError: mutapath.Path is an immutable class, unless mutate() context is used.
>>> folder
Path('/home/joe/doe/folder/sub')
```
```python
>>> with folder.mutate() as m:
...     m.name = "top"
>>> folder
Path('/home/joe/doe/folder/top')
```
```python
>>> next = Path("/home/joe/doe/folder/next")
>>> next.copy(folder)
>>> next
Path('/home/joe/doe/folder/next')
>>> folder.exists()
True
>>> folder.remove()
```
```python
>>> with next.renaming() as m:
...     m.stem = folder.stem
...     m.suffix = ".txt"
>>> next
Path("/home/joe/doe/folder/sub.txt")
>>> next.exists()
True
>>> next.with_name("next").exists()
False
```

For more in-depth examples, check the tests folder.

## Locks

Soft Locks can easily be accessed via the lazy lock property.
Moreover, the mutable context managers in `Path` (i.e., `renaming`, `moving`, `copying`) allow implicit locking.
The lock object is cached as long as the file is not mutated. 
Once the lock is mutated, it is released and regenerated, respecting the new file name.

```python
>>> my_path = Path('/home/doe/folder/sub')
>>> with my_path.lock:
...     my_path.write_text("I can write")
```

## Hashing

mutapath paths are hashable by caching the generated hash the first time it is accessed.
However, it also adds a warning so that unintended hash usage is avoided.
Once mutated after that, the generated hashes don't provide collision detection in binary trees anymore.
Don't use them in sets or as keys in dicts.
Use the explicit string representation instead, to make the hashing input transparent.

```python
>>> p = Path("/home")
>>> hash(p)
1083235232
>>> hash(Path("/home")) == hash(p)
True
>>> with p.mutate() as m:
...     m.name = "home4"
>>> hash(p) # same hash
1083235232
>>> hash(Path("/home")) == hash(p) # they are not equal anymore
True
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://mutapath.fax.fyi",
    "name": "mutapath",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "pathlib,mutable,path",
    "author": "matfax",
    "author_email": "mat@fax.fyi",
    "download_url": "https://files.pythonhosted.org/packages/e7/03/89b7833080a55ff812a5627a0e87b4fe703bb3f5a910c46eb28239ddd14f/mutapath-0.17.1.tar.gz",
    "platform": null,
    "description": "# mutapath\n\n[![GitHub Workflow Status (with branch)](https://img.shields.io/github/actions/workflow/status/matfax/mutapath/build.yml?branch=main&style=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&style=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&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjUgNSAzNzAgMzcwIj48Y2lyY2xlIGN4PSIxODkiIGN5PSIxOTAiIHI9IjE4NCIgZmlsbD0iI2ZlMiIvPjxwYXRoIGZpbGw9IiM4YmIiIGQ9Ik0yNTEgMjU2bC0zOC0zOGExNyAxNyAwIDAxMC0yNGw1Ni01NmMyLTIgMi02IDAtN2wtMjAtMjFhNSA1IDAgMDAtNyAwbC0xMyAxMi05LTggMTMtMTNhMTcgMTcgMCAwMTI0IDBsMjEgMjFjNyA3IDcgMTcgMCAyNGwtNTYgNTdhNSA1IDAgMDAwIDdsMzggMzh6Ii8+PHBhdGggZmlsbD0iI2Q1MSIgZD0iTTMwMCAyODhsLTggOGMtNCA0LTExIDQtMTYgMGwtNDYtNDZjLTUtNS01LTEyIDAtMTZsOC04YzQtNCAxMS00IDE1IDBsNDcgNDdjNCA0IDQgMTEgMCAxNXoiLz48cGF0aCBmaWxsPSIjYjMwIiBkPSJNMj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DE4em0tODkgOTBsMTgtMTggMTggMTgtMTggMTh6bTEzOS04NWwyMyAyM2M0IDQgNCAxMSAwIDE2TDE0MiAyNDBjLTQgNC0xMSA0LTE1IDBsLTI0LTI0Yy00LTQtNC0xMSAwLTE1bDEwMS0xMDFjNS01IDEyLTUgMTYgMHoiLz48cGF0aCBmaWxsPSIjM2VlIiBkPSJNMTM0IDk1bDE4LTE4IDE4IDE4LTE4IDE4em0tNTQgMThsMTgtMTcgMTggMTctMTggMTh6bTU1LTUzbDE4LTE4IDE4IDE4LTE4IDE4em05MyA0OGwtOC04Yy00LTUtMTEtNS0xNiAwTDEwMyAyMDFjLTQgNC00IDExIDAgMTVsOCA4Yy00LTQtNC0xMSAwLTE1bDEwMS0xMDFjNS00IDEyLTQgMTYgMHoiLz48cGF0aCBmaWxsPSIjOWVlIiBkPSJNMjcgMTMxbDE4LTE4IDE4IDE4LTE4IDE4em01NC01M2wxOC0xOCAxOCAxOC0xOCAxOHoiLz48cGF0aCBmaWxsPSIjMGFhIiBkPSJNMjMwIDExMGwxMyAxM2M0IDQgNCAxMSAwIDE2TDE0MiAyNDBjLTQgNC0xMSA0LTE1IDBsLTEzLTEzYzQgNCAxMSA0IDE1IDBsMTAxLTEwMWM1LTUgNS0xMSAwLTE2eiIvPjxwYXRoIGZpbGw9IiMxYWIiIGQ9Ik0xMzQgMjQ4Yy00IDAtOC0yLTExLTVsLTIzLTIzYTE2IDE2IDAgMDEwLTIzTDIwMSA5NmExNiAxNiAwIDAxMjIgMGwyNCAyNGM2IDYgNiAxNiAwIDIyTDE0NiAyNDNjLTMgMy03IDUtMTIgNXptNzgtMTQ3bC00IDItMTAxIDEwMWE2IDYgMCAwMDAgOWwyMyAyM2E2IDYgMCAwMDkgMGwxMDEtMTAxYTYgNiAwIDAwMC05bC0yNC0yMy00LTJ6Ii8+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&style=for-the-badge)](https://pypi.org/project/mutapath/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/mutapath?color=ff69b4&style=for-the-badge)](https://pypistats.org/packages/mutapath)\n[![GitHub Release Date](https://img.shields.io/github/release-date/matfax/mutapath?color=%23986293&style=for-the-badge)](https://github.com/matfax/mutapath/releases)\n[![GitHub last commit](https://img.shields.io/github/last-commit/matfax/mutapath?color=9cf&style=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>>> from mutapath import MutaPath\n```\n```python\n>>> folder = MutaPath(\"/home/joe/doe/folder/sub\")\n>>> folder\nPath('/home/joe/doe/folder/sub')\n```\n```python\n>>> folder.name = \"top\"\n>>> folder\nPath('/home/joe/doe/folder/top')\n```\n```python\n>>> next = MutaPath(\"/home/joe/doe/folder/next\")\n>>> next\nPath('/home/joe/doe/folder/next')\n```\n```python\n>>> next.rename(folder)\n>>> next\nPath('/home/joe/doe/folder/top')\n>>> next.exists()\nTrue\n>>> 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>>> from mutapath import Path\n```\n```python\n>>> folder = Path(\"/home/joe/doe/folder/sub\")\n>>> folder\nPath('/home/joe/doe/folder/sub')\n```\n```python\n>>> folder.name = \"top\"\nAttributeError: mutapath.Path is an immutable class, unless mutate() context is used.\n>>> folder\nPath('/home/joe/doe/folder/sub')\n```\n```python\n>>> with folder.mutate() as m:\n...     m.name = \"top\"\n>>> folder\nPath('/home/joe/doe/folder/top')\n```\n```python\n>>> next = Path(\"/home/joe/doe/folder/next\")\n>>> next.copy(folder)\n>>> next\nPath('/home/joe/doe/folder/next')\n>>> folder.exists()\nTrue\n>>> folder.remove()\n```\n```python\n>>> with next.renaming() as m:\n...     m.stem = folder.stem\n...     m.suffix = \".txt\"\n>>> next\nPath(\"/home/joe/doe/folder/sub.txt\")\n>>> next.exists()\nTrue\n>>> 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>>> my_path = Path('/home/doe/folder/sub')\n>>> 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>>> p = Path(\"/home\")\n>>> hash(p)\n1083235232\n>>> hash(Path(\"/home\")) == hash(p)\nTrue\n>>> with p.mutate() as m:\n...     m.name = \"home4\"\n>>> hash(p) # same hash\n1083235232\n>>> hash(Path(\"/home\")) == hash(p) # they are not equal anymore\nTrue\n```\n",
    "bugtrack_url": null,
    "license": "LGPL-3.0",
    "summary": "mutable pathlib",
    "version": "0.17.1",
    "project_urls": {
        "Documentation": "https://mutapath.fax.fyi",
        "Homepage": "https://mutapath.fax.fyi",
        "Repository": "https://github.com/matfax/mutapath"
    },
    "split_keywords": [
        "pathlib",
        "mutable",
        "path"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5ebcf2fc0891bebd041e1ab3785ba3e14737dcd38ac2957f25fb8c3e45c78a09",
                "md5": "1b3cb79a02945b2e9e85cedac1cfcaaf",
                "sha256": "81833d71e3c63a3b48c8cc1c0a9e6529541e7e6c610629afb206cdd7376ef0ee"
            },
            "downloads": -1,
            "filename": "mutapath-0.17.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1b3cb79a02945b2e9e85cedac1cfcaaf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 15200,
            "upload_time": "2023-07-13T14:19:58",
            "upload_time_iso_8601": "2023-07-13T14:19:58.159217Z",
            "url": "https://files.pythonhosted.org/packages/5e/bc/f2fc0891bebd041e1ab3785ba3e14737dcd38ac2957f25fb8c3e45c78a09/mutapath-0.17.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e70389b7833080a55ff812a5627a0e87b4fe703bb3f5a910c46eb28239ddd14f",
                "md5": "d8f0cd08c8aa79f4e30a4a69c4f84253",
                "sha256": "a36fbbc25fac3dd1e3bfbf63f566eef1771a54a9cfbfb11ae1b614b208bb7dd7"
            },
            "downloads": -1,
            "filename": "mutapath-0.17.1.tar.gz",
            "has_sig": false,
            "md5_digest": "d8f0cd08c8aa79f4e30a4a69c4f84253",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 16110,
            "upload_time": "2023-07-13T14:19:59",
            "upload_time_iso_8601": "2023-07-13T14:19:59.572658Z",
            "url": "https://files.pythonhosted.org/packages/e7/03/89b7833080a55ff812a5627a0e87b4fe703bb3f5a910c46eb28239ddd14f/mutapath-0.17.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-13 14:19:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "matfax",
    "github_project": "mutapath",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "mutapath"
}
        
Elapsed time: 0.09126s