Skip to main content

simplifies Windows path handling, providing short path name conversion and string path manipulation.

Tested against Windows 10 / Python 3.10 / Anaconda

pip install shortpath83

About

The provided Python library is focused on working with file and directory paths on Windows systems. It primarily offers two functions, get_short_path_name and convert_path_in_string, which help manage and manipulate file paths. While the library focuses on Windows path management, it also considers compatibility with non-Windows systems. It doesn't modify paths on non-Windows platforms, making it versatile for cross-platform development.

Here's a description of what the library is doing and the potential advantages it offers:

get_short_path_name Function:

Purpose: This function takes a long file or directory path as input and returns its short (8.3) path name on Windows systems.

Advantages:

  • Compatibility: It ensures compatibility with older Windows systems that use short path names for compatibility with legacy software.
  • Uniformity: Provides a standardized way to obtain short path names, which can be useful when working with mixed path formats.
  • Path Validation: The function checks if the input path is already in short format and only converts long paths if necessary.

convert_path_in_string Function:

Purpose: This function processes a string containing file and directory paths and replaces them with their short (8.3) path names on Windows systems.

Advantages:

  • String Manipulation: Allows you to efficiently manipulate strings containing paths by converting them to short names while preserving the original string's structure.
  • Flexibility: You can specify whether to convert paths to absolute paths, providing flexibility in how paths are represented in the output.
  • Automatic Path Detection: Automatically identifies valid paths within the input string, ensuring that only paths are converted.
from shortpath83 import get_short_path_name, convert_path_in_string
print(get_short_path_name(long_name=r"C:\Users\hansc\Downloads\RobloxPlayerLauncher (2).exe"))
print(convert_path_in_string(r"C:\Users\hansc\Downloads\RobloxPlayerLauncher (2).exe --somearg --another arg --somefile C:\Users\hansc\Downloads\1633513733_526_Roblox-Royale-High-Halloween-이벤트에서-사탕을-얻는-방법 (4).jpg --some_not_existing_file=c:\idontexistsandwontbeconverted", minlen=None, convert_to_abs_path=True))
C:\Users\hansc\DOWNLO~1\ROBLOX~3.EXE
C:\Users\hansc\DOWNLO~1\ROBLOX~3.EXE --somearg --another arg --somefile C:\Users\hansc\DOWNLO~1\164186~1.JPG --some_not_existing_file=c:\idontexistsandwontbeconverted

Metadata

Release files for shortpath83 0.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shortpath83 0.12
File Size Uploaded Provenance Actions
shortpath83-0.12.tar.gz 5.9 kB Without provenance Details for shortpath83-0.12.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for shortpath83 0.12
File Interpreter ABI Platform Actions
shortpath83-0.12-py3-none-any.whl Python 3 none any Details for shortpath83-0.12-py3-none-any.whl

Total release size: 13.5 kB

Release files / shortpath83-0.12.tar.gz

Download URL shortpath83-0.12.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4e9fb8bbe96424bf5648a968e32fb917f64b418ac0bb5aa71dbab57c9be09200
BLAKE2b-256 checksum
How to use checksums
a587c40e88872c10f68b053ef784827f450ac36e85f2053b0a58bb00e500225d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / shortpath83-0.12-py3-none-any.whl

Download URL shortpath83-0.12-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf277d0a11e24d8b02c84fa17b40b63d41245b714e700387e6255b0f641bf0f1
BLAKE2b-256 checksum
How to use checksums
3e0896711bfbfefdb6cfa445aafa2a272d4b9b96f95d5994ec02f3aba5d19001
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Security for shortpath83 0.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page