$npx skillfedfor your agent

oslex

OS-independent wrapper for shlex and mslex

Worth itPyPI UtilitiesReleased May 2026780.7K downloads / mopermissive licensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — oslex-2.0.0-py3-none-any.whl
v2.0.0 · released 2026-05-10 · Python >=3.8 · 1 runtime deps: mslex

Yes. It solves a real cross-platform pain point with minimal overhead (one dependency, low friction), active maintenance, no known vulnerabilities, and a permissive license. Install it if you build command-line tools or subprocess wrappers that must work on both Windows and POSIX systems.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low install friction with a single runtime dependency (mslex).
  • Actively maintained with recent commits and releases spanning multiple Python versions (3.8–3.14).

License · maintenance · safety

permissive license (permissive) — Permissive MIT license; the package itself is MIT-licensed, though it depends on mslex which is Apache 2.0-licensed, so combined use carries both permissive terms.

last release 2026-05-10 (96 days) · last repo commit 2026-05-10 · 10 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 780,671 downloads/mo, #5,082 on PyPI

Verify before relying

import oslex

# Quote arguments for the current platform
quoted = oslex.quote('my argument')

# Join a command list
cmd = oslex.join(['echo', 'hello world'])

# Split a command string
args = oslex.split('echo "hello world"')
  • Whether Path object support extends to all three main functions or only specific ones
  • Performance characteristics when handling large argument lists or deeply nested quoting
Same gist for agents: .md · .json

What it is and what it does

oslex is a thin abstraction layer that provides a single, consistent interface for shell argument handling across Windows and POSIX systems. It forwards calls to either the standard library's shlex (on POSIX) or the mslex library (on Windows), so developers can write platform-agnostic code without conditional logic. The three core functions—join(), quote(), and split()—mirror their underlying implementations but automatically select the right one based on the current OS.

The package is useful when building command-line tools, subprocess wrappers, or any code that constructs or parses shell commands and needs to work correctly on both Windows and Unix-like systems. It accepts Path objects as arguments and converts them transparently, and exposes platform-specific keyword arguments (prefixed ms_ or sh_) for fine-tuning behavior when needed. It also provides _sh and _ms variants to force a specific implementation regardless of platform.

Use it for

  • Build cross-platform CLI tools that safely escape and join command arguments without platform-specific branching
  • Parse shell command strings consistently on Windows and POSIX in subprocess or shell integration code
  • Quote file paths and arguments safely when constructing system commands in deployment or automation scripts
  • Handle mixed str and Path arguments in a single join or quote call without manual conversion
  • Test shell-quoting logic against both Windows and POSIX rules in the same codebase

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

It solves a real cross-platform pain point with minimal overhead (one dependency, low friction), active maintenance, no known vulnerabilities, and a permissive license. Install it if you build command-line tools or subprocess wrappers that must work on both Windows and POSIX systems.

Install

oslex on PyPI

Before you install

Low install friction with a single runtime dependency (mslex). Actively maintained with recent commits and releases spanning multiple Python versions (3.8–3.14).

License in practice

Permissive MIT license; the package itself is MIT-licensed, though it depends on mslex which is Apache 2.0-licensed, so combined use carries both permissive terms.

Quickstart

import oslex

# Quote arguments for the current platform
quoted = oslex.quote('my argument')

# Join a command list
cmd = oslex.join(['echo', 'hello world'])

# Split a command string
args = oslex.split('echo "hello world"')

Verify before relying

  • Whether Path object support extends to all three main functions or only specific ones
  • Performance characteristics when handling large argument lists or deeply nested quoting

Package facts

Licensepermissive license permissive
Python supportSupports the current Python release >=3.8
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
mslex
MaintenanceActively maintained 96 days since the last release
Last repo commit
First released
Downloads780,671 / month, #5,082 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
License :: OSI Approved :: MIT LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Evidence: oslex-2.0.0-py3-none-any.whl

Tags

Capabilities
cross-platform shell argument quotingwindows posix command line parsingshlex mslex wrapperos-independent shell escapingplatform-agnostic command splitting
Topics
cross-platformshell-integrationsubprocess

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “cross-platform shell argument quoting”

  • oslexProvides a unified API for shell argument quoting and parsing that…
  • mslexProvides Windows-compatible command-line argument parsing and…
  • shellescapeProvides a `quote()` function that shell-escapes Python strings to…

Give your agent the search over MCP, or paste the wish link into any chat.

More Utilities packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
charset-normalizer Worth it
PyPI · Utilities · released Aug 2026

Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.

permissive licensepure Python · 3.7+
1.7Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
pluggy Worth it
PyPI · Libraries · released May 2025

Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.

Install it if you're building an extensible application or framework.

MITpure Python · 3.9+aging
1.3Bdownloads / mo
Pygments Worth it
PyPI · Utilities · released Mar 2026

Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.

Install it if you need to display or transform source code.

BSD-2-Clausepure Python · 3.9+
1.3Bdownloads / mo
six With conditions
PyPI · Libraries · released Dec 2024

Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.

MITpure Python
1.2Bdownloads / mo

See also bashlex · mslex · shellescape · sspilib · shellcheck-py · manygo · flake8-quotes · quotequail · mozprocess · strict-kwargs