Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Python interface to your NPM and package.json.

Project Description

Python interface to your NPM and package.json.

Further documentation is available on


PyNPM is on PyPI so all you need is:

$ pip install pynpm


First point PyNPM to your package.json:

from pynpm import NPMPackage
pkg = NPMPackage('path/to/package.json')

Now you can run e.g. npm install from within Python:


Arguments are also support so you can run e.g. npm run build --report:

pkg.run_script('build', '--report')

Want to use yarn instead?

from pynpm import YarnPackage
pkg = YarnPackage('path/to/package.json')

By default NPM output is piped through and the function call will wait for NPM to finish. If you want to silence the output or interact with process pass wait=False and you will get a subprocess.POpen object back:

p = pkg.install(wait=False)

By default you can run the following NPM commands:

  • build
  • init
  • install
  • link
  • run-script
  • start
  • stop
  • test

You can also run other NPM commands or restrict which commands you can run:

pkg = NPMPackage('path/to/package.json', commands=['install'])


Version 0.1.1 (released 2017-05-16)

  • Fix problem with testing click CLI output.

Version 0.1.0 (released 2017-05-12)

  • Initial public release.
Release History

Release History

This version
History Node


History Node


Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pynpm-0.1.1-py2.py3-none-any.whl (6.9 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel May 16, 2017
pynpm-0.1.1.tar.gz (16.5 kB) Copy SHA256 Checksum SHA256 Source May 16, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting