Skip to main content
NIP - nip isn't pip
===================

A fast way to start and use a python project within a virtual
environment.


Commands
--------

> init - Initialize a new Python project in the current folder.

> install - Install all project dependencies and initialize a new venv if necessary.

> add - Install a new project dependency and add it to your nipfile. (like `pip install`)

> remove - Remove a dependency from your project. (like `pip uninstall`)

> run - Run a script from the nipfile


**Quick Start**

Enter an empty directory, type `nip init` and answer the questions.
this starts up a virtual environment for you under `./python_modules`.
You may also notice NIP has created these files in the cwd..

- `.gitignore` with the new `python_modules` included so you don't have to.
- `nip.json` file with you package details.
- `setup.py` file with a basic templated layout.

**Add a Dependency**

Run `nip add <package_name>` to install a new dependency. Nip creates a `requirements.txt` file and pins the version automatically.

*If it's a development dependency the use the option `-D`, ex: `nip add -D <package_name>` which creates a `dev_dependency.txt` file instead*

> PROTIP: Any binaries included with the added package also become available for use through nip `scripts` .. (see below)


**Scripts**

You can place shortcuts to commands in the `nipfile` under a scripts section (see example), which you can then run with
`nip run <script_name>` or just `nip <script_name>` and they will be started within the virtual environment. You can also
run any binaries installed to the `python_modules/bin` folder.

For example, if you have `tox` as a dependency, but not installed globally you can run it as a `script`, ex:

```sh
nip.json ..

{
...
"scripts": {
"start": "python src/main.py",
"db:migrate": "python manage.py migrate",
...
+ "test": "tox"
},
"dev_dependencies": {
+ "tox": "~=2.9.1",
...
}
}

$ nip run test // or just `nip test`
```



**Existing Projects**

Enter a directory with a `nipfile.json` and type `nip install` to
install any package requirements/virtual environments necessary for
the project and you're ready to go.


Example
-------

```sh
$ nip init
nip - v0.2.0 - Init - Made with Love, by Duroktar © 2018

Package Name (nip-test):
Author: Duroktar
Version (0.1.0):
License (MIT):
⠼ Initialising.... Done.
Finished.
```

> nip.json

```sh
{
"name": "nip-test",
"author": "Duroktar",
"version": "0.1.0",
"license": "MIT",
+ "scripts": {
+ "start": "python hello_world.py"
+ }
}
```

```sh

$ echo 'print("Hello world!!")' >> hello_world.py

$ nip start
nip - v0.2.0 - Run - Made with Love, by Duroktar © 2018

Hello world!!

```


Why?
----

Starting a new Python project from scratch isn't hard, but you end up
using similar patterns and multiple tools each time. I wanted to script
away as much of that as possible without coupling everything together
into something that ended up being complicated and unmanageable.

At its core, NIP is a service based framework with a middleware and
hooks based strategy. It was built to take advantage of existing
Python tools instead of trying to replace them. It uses `pip` under
the hood, so if you want stop using `nip` just remove the `nip.json`
file and you're left with a standard python package.


Development
-----------

I tried to make nip really easy to understand and work on, there's a useful
guide [here](./nip/services/README.md) in the services section that tries to give a basic rundown of
what happens when nip runs, and serves as a decent starting point for those
interested in helping out.


Third Party Packages
--------------------

NIP was heavily inspired by NPM/Yarn and the FeathersJS Framework.

- Click - http://click.pocoo.org/5/ - three-clause BSD License
- PySpin - https://pypi.python.org/pypi/pyspin - MIT
- Tox - https://tox.readthedocs.io/en/latest/ - MIT
- pytest - https://docs.pytest.org/en/latest/ - MIT
- flake8 - http://flake8.pycqa.org/en/latest/ - MIT
- venv_tools - ... - ...

License
-------

MIT




Metadata

Release files for nip.cli 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nip.cli 0.3.1
File Size Uploaded
nip.cli-0.3.1.tar.gz 16.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nip.cli 0.3.1
File Interpreter ABI Platform
nip.cli-0.3.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 41.0 kB

Release files / nip.cli-0.3.1.tar.gz

Download URL nip.cli-0.3.1.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d4bca7e198962b99caf90953a2cb3374ff67201e822da899cdee4557f6bf6716
BLAKE2b-256 checksum
How to use checksums
2935dbdc0c6a7047a1d7a2a8dbad08c0105c69c5c215ca215ea3c6c977089170
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / nip.cli-0.3.1-py2.py3-none-any.whl

Download URL nip.cli-0.3.1-py2.py3-none-any.whl
Size 24.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
0eff8838bca871810fbb06482aa98f3e526df46c70314d16e83abfba560476cf
BLAKE2b-256 checksum
How to use checksums
bc815b808d537e6f45560e7f9b9506cedcc3438e8d5c54523f4e5f904c51a077
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page