Skip to main content

Python module to convert between Windows and POSIX path

Project description

Licence Docs Python PyPI Conda

wslPath

wslPath is a Python module to convert between Windows and POSIX paths in WSL

Install

From PyPI:

pip install wslPath

From Conda:

conda install -c conda-forge wslPath

Usages

import wslPath

# Windows to Posix

## Relative path
pathwin = "hoge\\fuga"
wslPath.to_posix(pathwin)
# -> "hoge/fuga"

## Absolute path
pathwin = "C:\\hoge\\fuga"
wslPath.to_posix(pathwin)
# -> "/mnt/c/hoge/fuga"

# Posix to Windows

## Relative path
pathposix = "hoge/fuga"
wslPath.to_windows(pathposix)
# -> "hoge\\fuga"

## Absolute path
pathposix = "/mnt/c/hoge/fuga"
wslPath.to_windows(pathposix)
# -> "C:\\hoge\\fuga"

# Identify path type (POSIX or Windows)

path = "hoge/fuga"
wslPath.is_posix_path(path)
# -> True

path = "hoge\\fuga"
wslPath.is_posix_path(path)
# -> False

path = "hoge/fuga"
wslPath.is_windows_path(path)
# -> False

path = "hoge\\fuga"
wslPath.is_windows_path(path)
# -> True

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wslpath-0.4.2.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

wslPath-0.4.2-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file wslpath-0.4.2.tar.gz.

File metadata

  • Download URL: wslpath-0.4.2.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for wslpath-0.4.2.tar.gz
Algorithm Hash digest
SHA256 5140b75c8918da05eb79e3c6958bce2bb0d578bb7a83236445b644aeb005cdc5
MD5 694af1199f953357e60264a7cb00ac4b
BLAKE2b-256 73993d34e3612844fa0609b339e874844a108df7a38d7c1fe4b3b8ea00392969

See more details on using hashes here.

File details

Details for the file wslPath-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: wslPath-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for wslPath-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 40365018001f191cea9e57bbe736eb06d40c69a134b6f8611a338b11a3f8e492
MD5 1d53abf49a26a7b4ccf25fd986fedfb1
BLAKE2b-256 99022979d4d5ae5843fc5cbd45aaf27033764abef8b187a77c185e40d90acaa0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page