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 withpackage.ymland.venv(likenpm init)pynpm install <pkg>— Install a package and save it topackage.yml(likenpm install)pynpm install— Install all dependencies frompackage.yml/ lockfile (likenpm install)pynpm uninstall <pkg>— Remove a package and clean up orphaned transitive depspynpm list— Show project dependencies and their installed versionspynpm run <script>— Run scripts defined inpackage.yml(likenpm run)- Automatic
.venv— Creates and uses a virtual environment automatically - Lockfile —
package-lock.ymllocks 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
pynpm initcreatespackage.yml,.venv, and.gitignorepynpm install <pkg>installs into.venvvia pip, records the direct dependency inpackage.yml, and snapshots all installed versions intopackage-lock.ymlpynpm uninstall <pkg>removes the package, cleans up orphaned transitive deps, and updates both config filespynpm install(no args) readspackage-lock.ymlfor exact versions, or falls back topackage.ymlversion specs
Publishing to PyPI
This project uses GitHub Actions with PyPI trusted publishing. To publish:
- Configure trusted publishing on PyPI for your repository
- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pynpm_cli-0.1.3.tar.gz.
File metadata
- Download URL: pynpm_cli-0.1.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89d13ed3887223e87684c0def6e24f7caa9e15e37b4880d5ed32d3ccc2a802ae
|
|
| MD5 |
173051fae87d37a777e67129a12a41de
|
|
| BLAKE2b-256 |
9bd84fa4dc7e02f41e55391ad038ca0e8ed659d8f592cd37286a6a2cf44fa02b
|
Provenance
The following attestation bundles were made for pynpm_cli-0.1.3.tar.gz:
Publisher:
publish.yml on subh-skd/pynpm-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pynpm_cli-0.1.3.tar.gz -
Subject digest:
89d13ed3887223e87684c0def6e24f7caa9e15e37b4880d5ed32d3ccc2a802ae - Sigstore transparency entry: 1179271104
- Sigstore integration time:
-
Permalink:
subh-skd/pynpm-cli@e2ff50ca86870437521f4a86e86b688632b4ffbe -
Branch / Tag:
refs/heads/main - Owner: https://github.com/subh-skd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e2ff50ca86870437521f4a86e86b688632b4ffbe -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pynpm_cli-0.1.3-py3-none-any.whl.
File metadata
- Download URL: pynpm_cli-0.1.3-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e29f8c32d8da01ac10be3462c9871bfc07841dcd8bd521a6e2b3ea48ca4185fb
|
|
| MD5 |
a3f8f02afe9a658049b6733d4498df1b
|
|
| BLAKE2b-256 |
6b5ac99106651f98d6a8a7b2aba1c385c7142c9ff0fdde9178361eb96d630bf6
|
Provenance
The following attestation bundles were made for pynpm_cli-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on subh-skd/pynpm-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pynpm_cli-0.1.3-py3-none-any.whl -
Subject digest:
e29f8c32d8da01ac10be3462c9871bfc07841dcd8bd521a6e2b3ea48ca4185fb - Sigstore transparency entry: 1179271208
- Sigstore integration time:
-
Permalink:
subh-skd/pynpm-cli@e2ff50ca86870437521f4a86e86b688632b4ffbe -
Branch / Tag:
refs/heads/main - Owner: https://github.com/subh-skd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e2ff50ca86870437521f4a86e86b688632b4ffbe -
Trigger Event:
workflow_dispatch
-
Statement type: