nppm

An npm-like tool for Python projects


Keywords
development
License
GPL-2.0+
Install
pip install nppm==0.1.2

Documentation

Python Package Manager (PPM)

The goal of this project is very simple: given that I have a copy of a python project in a folder, I should be able to cd $FOLDER && ppm install && ppm run and it should just work.

The way that node with npm works is nice in its simplicity: a package declaration file (package.json) and a module directory (node_modules). It doesn’t care about multiple copies of the same package (each in a different node_modules folder), because not caring makes dependency management much easier.

I have modeled ppm after npm. The current implementation is built on top of pip, because that is the only effective way of having it work right now. However, usage is very similar to npm.

Installation

From PyPI

pip install --user nppm (or sudo pip install nppm if you prefer global installs)

From Source

  1. Clone the repository
  2. Run python setup.py --user install and make sure that ~/.local/bin is on your path.
  3. ppm is now installed!

Commands

  • ppm init

    Initializes a basic package.json in the current directory.

  • ppm install [--save] [<package(s)>]

    Installs one or more packages. If --save is specified, save the list of packages installed to package.json. If no packages are given, install the packages listed in package.json. Packages are installed in the project’s python_modules folder.

  • ppm start [args], ppm run [args]

    Run the python script specified as main in the package.json, supplying it args as arguments.

  • ppm python [args], ppm repl [args]

    Start an instance of IPython in the current directory which has the project’s python_modules folder in sys.path. Arguments are passed verbatim to IPython.

Immediate To-Do List

  • Way to specify ‘binaries’ Need to look at how npm does this.
  • ppm install -g Not a huge fan of global installs, but they are useful for packages which provide binaries.
  • Pre-install scripts

License

This software is licensed under GPLv3. Copyright 2014 J David Smith <emallson@atlanis.net>