shortpath83


Nameshortpath83 JSON
Version 0.12 PyPI version JSON
download
home_pagehttps://github.com/hansalemaos/shortpath83
Summarysimplifies Windows path handling, providing short path name conversion and string path manipulation
upload_time2023-09-11 23:50:27
maintainer
docs_urlNone
authorJohannes Fischer
requires_python
licenseMIT
keywords windows subprocess 83 short names
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# 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.


```python

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

```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hansalemaos/shortpath83",
    "name": "shortpath83",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "windows,subprocess,83,short names",
    "author": "Johannes Fischer",
    "author_email": "aulasparticularesdealemaosp@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/a5/87/c40e88872c10f68b053ef784827f450ac36e85f2053b0a58bb00e500225d/shortpath83-0.12.tar.gz",
    "platform": null,
    "description": "\r\n# simplifies Windows path handling, providing short path name conversion and string path manipulation.\r\n\r\n## Tested against Windows 10 / Python 3.10 / Anaconda\r\n\r\n## pip install shortpath83\r\n\r\n## About\r\n\r\nThe provided Python library is focused on working with file and directory paths on Windows systems. \r\nIt primarily offers two functions, get_short_path_name and convert_path_in_string, \r\nwhich help manage and manipulate file paths. \r\nWhile the library focuses on Windows path management, it also considers compatibility with non-Windows systems. \r\nIt doesn't modify paths on non-Windows platforms, making it versatile for cross-platform development.\r\n\r\n\r\nHere's a description of what the library is doing and the potential advantages it offers:\r\n\r\n## get_short_path_name Function:\r\n\r\nPurpose: This function takes a long file or directory path as input and returns its short (8.3) path name on Windows systems.\r\n\r\n#### Advantages:\r\n\r\n- Compatibility: It ensures compatibility with older Windows systems that use short path names for compatibility with legacy software.\r\n- Uniformity: Provides a standardized way to obtain short path names, which can be useful when working with mixed path formats.\r\n- Path Validation: The function checks if the input path is already in short format and only converts long paths if necessary.\r\n\r\n\r\n## convert_path_in_string Function:\r\n\r\nPurpose: This function processes a string containing file and directory paths and replaces them with their short (8.3) path names on Windows systems.\r\n\r\n#### Advantages:\r\n\r\n- String Manipulation: Allows you to efficiently manipulate strings containing paths by converting them to short names while preserving the original string's structure.\r\n- Flexibility: You can specify whether to convert paths to absolute paths, providing flexibility in how paths are represented in the output.\r\n- Automatic Path Detection: Automatically identifies valid paths within the input string, ensuring that only paths are converted.\r\n\r\n\r\n```python\r\n\r\nfrom shortpath83 import get_short_path_name, convert_path_in_string\r\nprint(get_short_path_name(long_name=r\"C:\\Users\\hansc\\Downloads\\RobloxPlayerLauncher (2).exe\"))\r\nprint(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-\uc774\ubca4\ud2b8\uc5d0\uc11c-\uc0ac\ud0d5\uc744-\uc5bb\ub294-\ubc29\ubc95 (4).jpg --some_not_existing_file=c:\\idontexistsandwontbeconverted\", minlen=None, convert_to_abs_path=True))\r\nC:\\Users\\hansc\\DOWNLO~1\\ROBLOX~3.EXE\r\nC:\\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\r\n\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "simplifies Windows path handling, providing short path name conversion and string path manipulation",
    "version": "0.12",
    "project_urls": {
        "Homepage": "https://github.com/hansalemaos/shortpath83"
    },
    "split_keywords": [
        "windows",
        "subprocess",
        "83",
        "short names"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3e0896711bfbfefdb6cfa445aafa2a272d4b9b96f95d5994ec02f3aba5d19001",
                "md5": "fdef22835ece14fee4bde8281b16c006",
                "sha256": "cf277d0a11e24d8b02c84fa17b40b63d41245b714e700387e6255b0f641bf0f1"
            },
            "downloads": -1,
            "filename": "shortpath83-0.12-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fdef22835ece14fee4bde8281b16c006",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 7588,
            "upload_time": "2023-09-11T23:50:26",
            "upload_time_iso_8601": "2023-09-11T23:50:26.726413Z",
            "url": "https://files.pythonhosted.org/packages/3e/08/96711bfbfefdb6cfa445aafa2a272d4b9b96f95d5994ec02f3aba5d19001/shortpath83-0.12-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a587c40e88872c10f68b053ef784827f450ac36e85f2053b0a58bb00e500225d",
                "md5": "dee6237e1523008c4c285f587fa1083b",
                "sha256": "4e9fb8bbe96424bf5648a968e32fb917f64b418ac0bb5aa71dbab57c9be09200"
            },
            "downloads": -1,
            "filename": "shortpath83-0.12.tar.gz",
            "has_sig": false,
            "md5_digest": "dee6237e1523008c4c285f587fa1083b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5879,
            "upload_time": "2023-09-11T23:50:27",
            "upload_time_iso_8601": "2023-09-11T23:50:27.876308Z",
            "url": "https://files.pythonhosted.org/packages/a5/87/c40e88872c10f68b053ef784827f450ac36e85f2053b0a58bb00e500225d/shortpath83-0.12.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-11 23:50:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hansalemaos",
    "github_project": "shortpath83",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "shortpath83"
}
        
Elapsed time: 0.16804s