wslconv


Namewslconv JSON
Version 0.0.1 PyPI version JSON
download
home_page
SummaryA utility for converting file paths between WSL and Windows formats
upload_time2023-11-02 22:29:37
maintainer
docs_urlNone
authorLasha Koroshinadze
requires_python>=3.6
licenseMIT License
keywords wsl windows subsystem for linux path conversion filesystem utilities windows and linux interoperability cross-platform paths path translation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # wslconv

[![Version](https://img.shields.io/pypi/v/wslconv)](https://pypi.org/project/wslconv)
[![License](https://img.shields.io/pypi/l/wslconv)](https://github.com/lashahub/wslconv/blob/main/LICENSE)

A utility for converting file paths between WSL (Windows Subsystem for Linux) and Windows formats.

**wslconv** helps developers working with WSL, bridge the path differences between Windows and Linux, making the
experience smoother and error-free.

## Features

- Detect and convert paths automatically based on their format.
- Support for native Linux paths, native Windows paths, Linux paths on Windows, and Windows paths on Linux.
- Simple, intuitive API for developers.

## Installation

To install **wslconv**, use pip:

```
pip install wslconv
```

## Quickstart

Here's a quick example:

```python
from wslconv import WSLPathConverter

# Create an instance with the path and distro name
converter = WSLPathConverter("C:\\Users\\user\\Documents", "Ubuntu")

# Convert to Linux format
linux_path = converter.to_linux()
print(linux_path)  # Expected: /mnt/c/Users/user/Documents

# Convert to Windows format
windows_path = converter.to_windows()
print(windows_path)  # Expected: C:\Users\user\Documents
```

## API Reference

### `WSLPathConverter`

Main class for the path conversion.

#### Methods

- `__init__(self, path, distro)`: Initialize with a path and the name of the WSL distro.
- `filesystem_type(self)`: Return the filesystem type of the path (`Linux` or `Windows`).
- `os_type(self)`: Return the OS type based on the path format (`Linux` or `Windows`).
- `to_linux(self)`: Convert the path to its Linux representation.
- `to_windows(self)`: Convert the path to its Windows representation.

## Contributing

Feel free to open issues or PRs if you find any bugs or have suggestions for improvements!

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "wslconv",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "WSL,Windows Subsystem for Linux,Path conversion,Filesystem utilities,Windows and Linux interoperability,Cross-platform paths,Path translation",
    "author": "Lasha Koroshinadze",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/17/1c/f51afa20cd6e2dc691d108372219c43860e47266996131ef18e6c261f9ed/wslconv-0.0.1.tar.gz",
    "platform": null,
    "description": "# wslconv\n\n[![Version](https://img.shields.io/pypi/v/wslconv)](https://pypi.org/project/wslconv)\n[![License](https://img.shields.io/pypi/l/wslconv)](https://github.com/lashahub/wslconv/blob/main/LICENSE)\n\nA utility for converting file paths between WSL (Windows Subsystem for Linux) and Windows formats.\n\n**wslconv** helps developers working with WSL, bridge the path differences between Windows and Linux, making the\nexperience smoother and error-free.\n\n## Features\n\n- Detect and convert paths automatically based on their format.\n- Support for native Linux paths, native Windows paths, Linux paths on Windows, and Windows paths on Linux.\n- Simple, intuitive API for developers.\n\n## Installation\n\nTo install **wslconv**, use pip:\n\n```\npip install wslconv\n```\n\n## Quickstart\n\nHere's a quick example:\n\n```python\nfrom wslconv import WSLPathConverter\n\n# Create an instance with the path and distro name\nconverter = WSLPathConverter(\"C:\\\\Users\\\\user\\\\Documents\", \"Ubuntu\")\n\n# Convert to Linux format\nlinux_path = converter.to_linux()\nprint(linux_path)  # Expected: /mnt/c/Users/user/Documents\n\n# Convert to Windows format\nwindows_path = converter.to_windows()\nprint(windows_path)  # Expected: C:\\Users\\user\\Documents\n```\n\n## API Reference\n\n### `WSLPathConverter`\n\nMain class for the path conversion.\n\n#### Methods\n\n- `__init__(self, path, distro)`: Initialize with a path and the name of the WSL distro.\n- `filesystem_type(self)`: Return the filesystem type of the path (`Linux` or `Windows`).\n- `os_type(self)`: Return the OS type based on the path format (`Linux` or `Windows`).\n- `to_linux(self)`: Convert the path to its Linux representation.\n- `to_windows(self)`: Convert the path to its Windows representation.\n\n## Contributing\n\nFeel free to open issues or PRs if you find any bugs or have suggestions for improvements!\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "A utility for converting file paths between WSL and Windows formats",
    "version": "0.0.1",
    "project_urls": {
        "Homepage": "https://github.com/lashahub/wslconv"
    },
    "split_keywords": [
        "wsl",
        "windows subsystem for linux",
        "path conversion",
        "filesystem utilities",
        "windows and linux interoperability",
        "cross-platform paths",
        "path translation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "65c908dbc942e5d21d7b8626e83afe8f7f921a136bc724f550f98861b219c25a",
                "md5": "7e0096834d9f3eaf2452b4687c5ccd78",
                "sha256": "d4f2921eda7fe428ffc8bdbde909d9a5d895dc10566db97156184ed9766c00dc"
            },
            "downloads": -1,
            "filename": "wslconv-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7e0096834d9f3eaf2452b4687c5ccd78",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 3850,
            "upload_time": "2023-11-02T22:29:35",
            "upload_time_iso_8601": "2023-11-02T22:29:35.735854Z",
            "url": "https://files.pythonhosted.org/packages/65/c9/08dbc942e5d21d7b8626e83afe8f7f921a136bc724f550f98861b219c25a/wslconv-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "171cf51afa20cd6e2dc691d108372219c43860e47266996131ef18e6c261f9ed",
                "md5": "c6ad81189b1e12f80cf53f7b4a6e14db",
                "sha256": "92c45add9eac612e03078102beefa0989b390c49f4c592cb889cd57512e3b518"
            },
            "downloads": -1,
            "filename": "wslconv-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "c6ad81189b1e12f80cf53f7b4a6e14db",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 3998,
            "upload_time": "2023-11-02T22:29:37",
            "upload_time_iso_8601": "2023-11-02T22:29:37.275816Z",
            "url": "https://files.pythonhosted.org/packages/17/1c/f51afa20cd6e2dc691d108372219c43860e47266996131ef18e6c261f9ed/wslconv-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-02 22:29:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lashahub",
    "github_project": "wslconv",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "wslconv"
}
        
Elapsed time: 0.14603s