--- id: mslex version: "1.3.0" license: Apache Software License 2.0 license_treatment: permissive maintenance: dormant --- # mslex — shlex for windows License: permissive · Maintenance: dormant · Downloads: 1.1M/mo ## What it is and what it does mslex is a Windows-specific port of Python's shlex module that correctly handles Windows command-line quoting and parsing. Unlike shlex, which follows POSIX conventions, mslex accounts for the quirks of Windows argument parsing—specifically the different behaviors between legacy msvcrt.dll (which exhibits modulo-3 periodic quoting behavior from pre-VS 2005) and modern C runtimes (UCRT from VS 2005 onward). The package provides three functions—split, quote, and join—mirroring shlex's interface. When parsing, mslex validates that a quoted string parses identically under both legacy and modern rules, raising an error if they disagree; you can override this by explicitly setting ucrt=True or ucrt=False. This is useful for developers building command-line tools on Windows, cross-platform build systems, or tools that invoke other Windows programs and need to correctly escape arguments. The package has no runtime dependencies and is marked Production/Stable, though development is dormant. Use it for: - Building cross-platform CLI tools that need to invoke Windows executables with properly escaped arguments. - Implementing build systems or package managers that must handle Windows command-line parsing correctly. - Parsing command-line arguments from Windows programs that use either legacy or modern C runtime conventions. - Testing or validating Windows argument quoting in tools that generate Windows batch or PowerShell commands. - Migrating POSIX shell scripts to Windows while preserving correct argument handling. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides Windows-compatible command-line argument parsing and quoting, handling both legacy (pre-VS 2005) and modern C runtime argument-parsing behaviors that standard shlex does not support. Yes, if you are building Windows command-line tools or cross-platform systems that invoke Windows programs. The package solves a real, non-obvious problem (Windows quoting is genuinely different from POSIX) with no dependencies and permissive licensing. However, dormant maintenance (667 days since last release) means you should verify it handles your specific Windows versions and C runtime targets before relying on it in production. ## Install pip install mslex uv add mslex poetry add mslex ## Installing mslex Before you install: Low install friction; pure Python wheel with no runtime dependencies. Maintenance is dormant—last release was 667 days ago and the repository shows no recent activity, though it is not archived. License in practice: Apache Software License 2.0 is permissive; you may use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions. Quickstart: pip install mslex import mslex quoted = mslex.quote('argument with spaces') args = mslex.split(quoted) Requires Python 3.5 or later; designed for Windows but can be imported on other platforms. Verify before relying: - Whether the package handles all edge cases in modern Windows command-line parsing beyond the documented VS 2005+ and msvcrt.dll behaviors. - How well the package performs on non-Windows platforms when imported (whether it gracefully degrades or requires conditional logic). - Real-world compatibility with Windows 11 and current C runtime versions. ## Package facts - License: Apache Software License 2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 1.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags windows command line parsing, shell quoting windows, msvcrt argument parsing, windows shlex alternative, command line escaping windows, ucrt argument splitting, windows shell quote, windows-cli, argument-parsing [View on SkillFed](https://skillfed.io/packages/mslex) · [View on PyPI](https://pypi.org/project/mslex/)