pare-python

v0.24.2
io.github.Dave-London/pare-python Checked 6 hours ago Published 3 days ago

Pare Python ג€” Structured Python tool output (ruff, mypy, pip, uv, black, pytest) as typed JSON.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

pip-install pip Install

Runs pip install and returns a structured summary of installed packages. WARNING: may execute untrusted code.

ParameterTypeDescription
compactbooleanPrefer compact output
constraintstringPath to constraints file for version pinning (-c FILE)
dryRunbooleanPreview what would be installed without actually installing (--dry-run)
editablestringPath to local package for editable install (-e PATH)
extraIndexUrlarrayExtra package index URLs for additional registries
forceReinstallbooleanForce reinstall of all packages even if already installed (--force-reinstall)
indexUrlstringBase URL of the Python Package Index (-i URL)
noDepsbooleanDo not install package dependencies (--no-deps)
packagesarrayPackages to install (empty for requirements.txt)
pathstringWorking directory
prebooleanInclude pre-release and development versions (--pre)
reportstringWrite JSON install report to file (--report FILE)
requirementsstringPath to requirements file
targetstringInstall packages into target directory (-t DIR)
upgradebooleanUpgrade already-installed packages to the newest version (--upgrade / -U)

pip-list pip List

Runs pip list and returns a structured list of installed packages.

ParameterTypeDescription
compactbooleanPrefer compact output
editablebooleanOnly list editable packages (-e, --editable)
excludearrayPackage names to exclude from output
excludeEditablebooleanExclude editable packages from the list (--exclude-editable)
localbooleanOnly list packages in the local virtualenv (-l, --local)
notRequiredbooleanList packages that are not dependencies of other packages (--not-required)
outdatedbooleanOnly list outdated packages with their latest available versions (--outdated)
pathstringWorking directory
userbooleanOnly list packages installed in user-site (--user)

pip-show pip Show

Runs pip show and returns structured package metadata (name, version, summary, dependencies). Supports multiple packages in a single call.

ParameterTypeDescription
compactbooleanPrefer compact output
filesbooleanList installed files for the package (-f, --files)
packagestringSingle package name to show (for backward compatibility)
packagesarrayPackage names to show (supports multiple packages)
pathstringWorking directory

mypy mypy Type Check

Runs mypy and returns structured type-check diagnostics (file, line, severity, message, code).

ParameterTypeDescription
compactbooleanPrefer compact output
configFilestringPath to mypy config file (--config-file)
disallowAnyGenericsbooleanDisallow usage of generic types without explicit parameters (--disallow-any-generics)
disallowIncompleteDefsbooleanDisallow partially typed function definitions (--disallow-incomplete-defs)
disallowUntypedCallsbooleanDisallow calling untyped functions from typed contexts (--disallow-untyped-calls)
disallowUntypedDefsbooleanDisallow defining functions without type annotations (--disallow-untyped-defs)
excludestringRegular expression to exclude files/directories
followImportsstringHow to handle imports (normal/silent/skip/error)
ignoreMissingImportsbooleanSuppress errors about missing imports for projects with incomplete stubs (--ignore-missing-imports)
installTypesbooleanAuto-install missing type stubs (--install-types --non-interactive)
modulestringSpecific module to type-check (-m MODULE)
noIncrementalbooleanDisable incremental mode (--no-incremental)
packagestringSpecific package to type-check (-p PACKAGE)
pathstringProject root path
pythonPathstringPython interpreter path to use (overrides executable/PATH fallback)
pythonVersionstringPython version to target (e.g. '3.11')
strictbooleanEnable strict mode for thorough type checking (--strict)
targetsarrayFiles or directories to check (default: ['.'])
warnRedundantCastsbooleanWarn about redundant type casts (--warn-redundant-casts)
warnReturnAnybooleanWarn about returning values of type Any (--warn-return-any)
warnUnreachablebooleanWarn about statically unreachable code (--warn-unreachable)
warnUnusedIgnoresbooleanWarn about unnecessary # type: ignore comments (--warn-unused-ignores)

ruff-check ruff Lint

Runs ruff check and returns structured lint diagnostics (file, line, code, message).

ParameterTypeDescription
compactbooleanPrefer compact output
configstringPath to custom ruff config file
diffbooleanShow diff of fixes without applying (--diff)
excludearrayFile patterns to exclude from checking
fixbooleanAuto-fix problems
ignorearrayRule codes or prefixes to suppress (e.g. ['E501'])
lineLengthintegerOverride the configured line length (--line-length)
noCachebooleanDisable cache (--no-cache)
pathstringProject root path
previewbooleanEnable preview rules (--preview)
pythonPathstringPython interpreter path to use (overrides executable/PATH fallback)
selectarrayRule codes or prefixes to enable (e.g. ['E', 'F401'])
statisticsbooleanShow rule violation statistics (--statistics)
targetVersionstringPython version target override (e.g. 'py38')
targetsarrayFiles or directories to check (default: ['.'])
unsafeFixesbooleanApply unsafe fixes in addition to safe ones (--unsafe-fixes)

ruff-format ruff Format

Runs ruff format and returns structured results (files changed, file list).

ParameterTypeDescription
checkbooleanCheck mode (report without modifying files)
compactbooleanPrefer compact output
configstringPath to custom ruff config file
diffbooleanShow diff of formatting changes without applying (--diff)
excludearrayFile patterns to exclude from formatting
indentWidthintegerOverride the configured indent width (--indent-width)
isolatedbooleanIgnore all configuration files (--isolated)
lineLengthintegerOverride the configured line length (--line-length)
noCachebooleanDisable cache (--no-cache)
pathstringProject root path
patternsarrayFiles or directories to format (default: ["."])
previewbooleanEnable preview formatting rules (--preview)
pythonPathstringPython interpreter path to use (overrides executable/PATH fallback)
quoteStylestringQuote style override for formatting
rangestringLine range for formatting (e.g. '10-20')
targetVersionstringPython version target override (e.g. 'py38')

pip-audit pip Audit

Runs pip-audit and returns a structured vulnerability report.

ParameterTypeDescription
compactbooleanPrefer compact output
dryRunbooleanPreview fix changes without applying (--dry-run)
fixbooleanAuto-remediate vulnerabilities (--fix)
ignoreVulnarrayVulnerability IDs to suppress (e.g. PYSEC-2023-001)
indexUrlstringCustom package index URL for corporate/private registry support
localbooleanOnly audit packages in the local virtualenv (-l, --local)
noDepsbooleanSkip auditing dependencies (--no-deps)
pathstringProject root path
requirementsstringPath to requirements file
skipEditablebooleanSkip auditing editable packages (--skip-editable)
strictbooleanFail on skipped dependencies (-S, --strict)
vulnerabilityServicestringVulnerability service to query (default: pypi)

pytest pytest

Runs pytest and returns structured test results (passed, failed, errors, skipped, failures).

ParameterTypeDescription
collectOnlybooleanOnly collect tests, do not run them (--collect-only)
compactbooleanPrefer compact output
configFilestringPath to pytest config file (-c FILE)
coveragestringSource directory for coverage measurement (--cov=SOURCE)
envobjectAdditional environment variables for the pytest process, merged over the parent environment (e.g. {"PYTHONPATH": "src"} for src-layout projects)
exitFirstbooleanStop on first failure (-x)
extraArgsarrayAdditional pytest CLI arguments passed through verbatim (e.g. ["-p", "no:logfire"] to disable a broken plugin). Each element is validated for control characters. Verbosity is set by the tool: -v/-vv/-…
keywordstringKeyword expression for test filtering (-k EXPR)
lastFailedbooleanRe-run only tests that failed last time (--lf)
markersstringPytest marker expression (e.g. "not slow")
maxFailintegerStop after N failures (--maxfail=N)
noCapturebooleanDisable stdout/stderr capturing, useful for print-debugging (-s)
parallelintegerNumber of parallel workers for pytest-xdist (-n NUM, 0=auto)
pathstringProject root path
pythonPathstringPython interpreter path to use (overrides venv/PATH detection)
targetsarrayTest files or directories to run (default: auto-discover)
tracebackStylestringTraceback output style (default: short)
verbosebooleanEnable verbose output (verbosity 1). For more, add "-vv" to extraArgs, e.g. to see a full assertion diff

uv-install uv Install

Runs uv pip install and returns a structured summary of installed packages. WARNING: may execute untrusted code.

ParameterTypeDescription
compactbooleanPrefer compact output
constraintstringPath to constraints file for version pinning (-c FILE)
dryRunbooleanPreview what would be installed without actually installing (--dry-run)
editablestringPath to local package for editable install (-e PATH)
extrasarrayPackage extras to install (--extra NAME)
indexUrlstringBase URL of the Python Package Index (-i URL)
noDepsbooleanDo not install package dependencies (--no-deps)
packagesarrayPackages to install
pathstringWorking directory
pythonstringPython interpreter version to use (-p VERSION)
reinstallbooleanForce reinstall of all packages even if already installed (--reinstall)
requirementsstringPath to requirements file
upgradebooleanUpgrade already-installed packages to the newest version (--upgrade)
verifyHashesbooleanVerify package hashes for supply-chain security (--verify-hashes)

uv-run uv Run

Runs a command in a uv-managed environment and returns structured output.

ParameterTypeDescription
command *arrayCommand and arguments to run (e.g. ['python', 'script.py'])
compactbooleanPrefer compact output
envFilestringPath to environment file (--env-file FILE)
frozenbooleanRun without updating the lockfile (--frozen)
isolatedbooleanRun in a clean isolated environment (--isolated)
lockedbooleanAssert the lockfile is up-to-date (--locked)
modulebooleanRun as python -m <module> instead of a script (-m)
noSyncbooleanSkip syncing the environment for faster execution (--no-sync)
outputLimitintegerMaximum characters to return for stdout/stderr before truncation
pathstringWorking directory
pythonstringPython interpreter version to use (-p VERSION)
withPackagesarrayAdditional packages to inject for one-off use (--with PKG)

black Black Formatter

Runs Black code formatter and returns structured results (files changed, unchanged, would reformat).

ParameterTypeDescription
checkbooleanCheck mode (report without modifying files)
compactbooleanPrefer compact output
configstringPath to explicit Black config file (--config)
diffbooleanShow diff of changes without applying (--diff)
lineLengthintegerOverride the configured line length (--line-length)
pathstringProject root path
previewbooleanEnable preview style (--preview)
skipStringNormalizationbooleanSkip string quote normalization (-S)
targetVersionstringPython version to target, e.g. 'py310', 'py311', 'py312' (--target-version)
targetsarrayFiles or directories to format (default: ["."])

conda Conda

Runs conda commands (list, info, env-list, create, remove, update) and returns structured JSON output.

ParameterTypeDescription
action *stringConda action to perform
allbooleanFor update action, update all installed packages (--all)
compactbooleanPrefer compact output
namestringEnvironment name (used with 'list' action to list packages in a specific env)
packageFilterstringRegex filter for conda list to show only matching packages
packagesarrayPackages used by create/remove/update actions
pathstringWorking directory
prefixstringEnvironment prefix path as alternative to name (--prefix DIR)

pyenv pyenv

Manages Python versions via pyenv.

ParameterTypeDescription
action *stringThe pyenv action to perform
commandstringCommand name for `which` action (e.g. python, pip)
compactbooleanPrefer compact output
forcebooleanForce reinstallation of an already installed version (--force)
pathstringWorking directory
skipExistingbooleanSkip installation if version is already installed (--skip-existing)
unsetbooleanClear local/global version setting (--unset)
versionstringPython version string (required for install/uninstall/local/global, e.g. '3.12.0')

poetry Poetry

Runs Poetry commands and returns structured output. Supports install, add, remove, show, build, update, lock, check, and export actions.

ParameterTypeDescription
action *stringPoetry action to perform
compactbooleanPrefer compact output
dryRunbooleanPreview changes without applying, for install/add/remove (--dry-run)
exportFormatstringExport format for export action
formatstringBuild output format for build action
groupstringDependency group for install/add/remove (e.g. 'dev')
latestbooleanShow latest available version, for show action (--latest)
outdatedbooleanShow only outdated packages, for show action (--outdated)
outputstringOutput file for export action (-o FILE)
packagesarrayPackages for add/remove actions
pathstringWorking directory
treebooleanShow dependency tree, for show action (--tree)
withoutHashesbooleanExclude hashes in exported requirements (--without-hashes)