Skip to main content

An npm-like package manager for Python that uses pip under the hood

Project description

pynpm — An npm-like Package Manager for Python

pynpm is a Python package manager inspired by npm. It uses pip under the hood but gives you clean dependency management with package.yml and package-lock.yml, automatic virtual environment handling, and no unnecessary transitive dependencies polluting your project.

Features

  • pynpm init — Initialize a project with package.yml and .venv (like npm init)
  • pynpm install <pkg> — Install a package and save it to package.yml (like npm install)
  • pynpm install — Install all dependencies from package.yml / lockfile (like npm install)
  • pynpm uninstall <pkg> — Remove a package and clean up orphaned transitive deps
  • pynpm list — Show project dependencies and their installed versions
  • pynpm run <script> — Run scripts defined in package.yml (like npm run)
  • Automatic .venv — Creates and uses a virtual environment automatically
  • Lockfilepackage-lock.yml locks exact versions for reproducible installs
  • Orphan cleanup — Uninstalling a package also removes its unused transitive dependencies

Installation

pip install pynpm-cli

Quick Start

# Create a new project
mkdir my-project && cd my-project
pynpm init

# Install packages
pynpm install requests
pynpm install flask

# Install dev dependencies
pynpm install -D pytest

# Install all deps from package.yml (like npm install)
pynpm install

# Run a script
pynpm run test

# Remove a package
pynpm uninstall flask

# List dependencies
pynpm list

package.yml

Your project configuration lives in package.yml:

name: my-project
version: 1.0.0
description: My awesome project
author: Your Name
license: MIT
python: ">=3.8"

scripts:
  start: python main.py
  test: pytest

dependencies:
  requests: "==2.31.0"
  flask: "==3.0.0"

dev_dependencies:
  pytest: "==8.0.0"

package-lock.yml

The lockfile captures the exact versions of all installed packages (including transitive dependencies) for reproducible installs:

lockfile_version: 1
packages:
  requests:
    version: "2.31.0"
  urllib3:
    version: "2.1.0"
  charset-normalizer:
    version: "3.3.2"

Command Aliases

Full Command Alias
pynpm install pynpm i
pynpm uninstall pynpm rm

How It Works

  1. pynpm init creates package.yml, .venv, and .gitignore
  2. pynpm install <pkg> installs into .venv via pip, records the direct dependency in package.yml, and snapshots all installed versions into package-lock.yml
  3. pynpm uninstall <pkg> removes the package, cleans up orphaned transitive deps, and updates both config files
  4. pynpm install (no args) reads package-lock.yml for exact versions, or falls back to package.yml version specs

Publishing to PyPI

This project uses GitHub Actions with PyPI trusted publishing. To publish:

  1. Configure trusted publishing on PyPI for your repository
  2. Create a GitHub release — the workflow builds and publishes automatically

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pynpm_cli-0.1.2.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pynpm_cli-0.1.2-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file pynpm_cli-0.1.2.tar.gz.

File metadata

  • Download URL: pynpm_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pynpm_cli-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f8bc5fca9b5141fbd0dc3fdf92b8d53e65c692c4eaee9774707bd90b85dbc9a5
MD5 de3a4f314fb3cbc575be7a5467e1bdc7
BLAKE2b-256 c93a50b0f6e3c5b696ebb852c60d97ea216134bef4abcf4dd38270f50d3c849a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pynpm_cli-0.1.2.tar.gz:

Publisher: publish.yml on subh-skd/pynpm-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pynpm_cli-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pynpm_cli-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pynpm_cli-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7e26536dfed2ef28e3348cd101f2314794f5a6897d625a7c80fb6cd8024cf205
MD5 61a952c565abeabcd8363b2b179f37e5
BLAKE2b-256 e117be33b9204b5d4b8f1fb4a148061e66411eabcdfb92758af61d9276c65970

See more details on using hashes here.

Provenance

The following attestation bundles were made for pynpm_cli-0.1.2-py3-none-any.whl:

Publisher: publish.yml on subh-skd/pynpm-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page