skillfed

node-semver

port of node-semver

node-semver v0.9.1 2.2M downloads/30d#3,240 on PyPI23
Permissive license mit Active released

What it is and what it does

node-semver is a Python port of the Node.js semver library, providing semantic version parsing, comparison, and range matching. It lets you evaluate version strings against semver range expressions (like '~1.2.3'), find the highest version in a list that satisfies a constraint, and validate version strings. The library handles prerelease versions, loose parsing modes, and multi-digit version components.

You'd use it when your Python application needs to resolve version constraints the way Node.js does—for example, in package managers, dependency resolvers, or any tool that must respect npm-style version semantics. It has no external dependencies and supports modern Python versions.

Use it for:

  • Resolve version constraints in a Python package manager or dependency resolver using Node.js semver rules.
  • Filter a list of available versions to find the best match for a given semver range expression.
  • Validate and compare version strings in build or deployment tools that must interoperate with Node.js ecosystems.
  • Handle prerelease and build metadata in version selection logic with fine-grained control over inclusion rules.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Parses and compares semantic version strings using Node.js semver rules, including range matching and prerelease handling.

Yes. Low install friction, no dependencies, active maintenance, permissive license, and no known vulnerabilities make it a safe choice. Install it if you need Node.js-compatible semver semantics in Python; skip it if you only need basic version comparison or Python's own versioning rules.

Install

node-semver on PyPI

pip

pip install node-semver

uv

uv add node-semver

poetry

poetry add node-semver

Installing node-semver

Before you install

Low friction install with no runtime dependencies. Actively maintained as of 2026-06-23 with recent updates.

License in practice

MIT license permits free use, modification, and distribution with minimal restrictions.

Quickstart

pip install node-semver

from node-semver import max_satisfying
versions = ['1.2.3', '1.2.4', '1.2.5', '1.2.6']
result = max_satisfying(versions, '~1.2.3')

Verify before relying

  • Whether all Node.js semver semantics are fully implemented or if there are known gaps vs. the original.
  • Performance characteristics when handling large version lists or complex range expressions.
  • Which specific functions beyond max_satisfying are available in the public API.

Package facts

License mit (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 52 days since the last release
Last repo commit
First released
Downloads 2,162,742/month — #3,240 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: node_semver-0.9.1-py3-none-any.whl

Keywords: version, semver, node-semver

Programming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: Implementation :: CPython

Tags

semantic versioningsemver range matchingversion comparisonnode-semver pythonversion constraint resolutionprerelease version handling
version-managementsemver

More Software Development packages