Manage Python dependencies via a requirements.json file — npm-style, powered by pip.
Project description
pip-json
A lightweight dependency management layer on top of pip, inspired by npm's package.json.
pip-json introduces requirements.json as the project-level dependency manifest. It does not replace pip — it delegates all installs to pip while keeping your dependency intent and resolved state in JSON.
Installation
pip install pip-json
For development:
pip install -e ".[testing]"
Usage
Install packages
pip-json install requests
pip-json install "requests>=2.0" flask
Installs via pip and writes the constraint to requirements.json. The resolved exact version is written to requirements.lock.json.
Install from a project
pip-json install # uses requirements.json in or above cwd
pip-json install . # uses requirements.json in current directory
pip-json install ../other # uses requirements.json in another directory
Freeze the current environment
pip-json freeze
Captures all installed packages with exact versions into requirements.lock.json. Does not touch requirements.json.
Sync the environment to your manifest
pip-json sync
Installs all packages listed in requirements.json (using their constraints) and updates requirements.lock.json with resolved versions.
File Format
requirements.json — your project's dependency intent:
{
"dependencies": {
"requests": ">=2.0",
"flask": "*"
}
}
requirements.lock.json — exact resolved versions, always co-located with requirements.json:
{
"dependencies": {
"requests": "2.32.5",
"flask": "3.1.0"
}
}
Commit both files. requirements.json expresses what you want; requirements.lock.json records what pip resolved.
File Discovery
pip-json treats dependency files as project-scoped, not environment-scoped.
Starting from the current directory, it walks up the directory tree until requirements.json is found. If none is found, it creates one in the current directory. This means:
- You can run
pip-jsonfrom any subdirectory of your project. - Monorepos with nested projects work as expected.
Design
| Concern | Responsibility |
|---|---|
| Installing packages | pip (environment-level) |
| Recording dependency intent | requirements.json (project-level) |
| Recording resolved versions | requirements.lock.json (project-level) |
pip-json sits between your project and pip — a thin, predictable layer with no magic.
Why JSON?
- Structured and machine-readable
- Easy to extend (dev deps, metadata, etc.)
- Familiar to developers coming from npm / yarn
Why not modify pip?
pip has no plugin system and its internal APIs are unstable. A subprocess wrapper is more stable and simpler to reason about.
Contributing
See CONTRIBUTING.md.
Changelog
See CHANGELOG.md.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
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 pip_json-0.1.1.tar.gz.
File metadata
- Download URL: pip_json-0.1.1.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23e2c6fcc9f68841da076f40021cebe9236ed441a6ccb0533e1d575c1091a08d
|
|
| MD5 |
7e32ef5036f0051bb13d7464c7ba72a9
|
|
| BLAKE2b-256 |
3e435647e4206b4d39fd5483a5c2550ea86f3d28d29f678d686808ab8a8731e4
|
Provenance
The following attestation bundles were made for pip_json-0.1.1.tar.gz:
Publisher:
publish.yml on EkberHasanov/pip-json
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pip_json-0.1.1.tar.gz -
Subject digest:
23e2c6fcc9f68841da076f40021cebe9236ed441a6ccb0533e1d575c1091a08d - Sigstore transparency entry: 1237711808
- Sigstore integration time:
-
Permalink:
EkberHasanov/pip-json@3ddf36f1e47b83309f812c9d8c14939217413830 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/EkberHasanov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3ddf36f1e47b83309f812c9d8c14939217413830 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pip_json-0.1.1-py2.py3-none-any.whl.
File metadata
- Download URL: pip_json-0.1.1-py2.py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df4b2ae32082a89aa9cc95688e0592c1d6afe26e215c3c95a1114df9261e369f
|
|
| MD5 |
100158135d90a0058bdc43562cac9f2e
|
|
| BLAKE2b-256 |
20177d33dc2f93cc5bda8bcf7a19d4676ec2cc44a0af7e793be3f8f89def54d7
|
Provenance
The following attestation bundles were made for pip_json-0.1.1-py2.py3-none-any.whl:
Publisher:
publish.yml on EkberHasanov/pip-json
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pip_json-0.1.1-py2.py3-none-any.whl -
Subject digest:
df4b2ae32082a89aa9cc95688e0592c1d6afe26e215c3c95a1114df9261e369f - Sigstore transparency entry: 1237711810
- Sigstore integration time:
-
Permalink:
EkberHasanov/pip-json@3ddf36f1e47b83309f812c9d8c14939217413830 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/EkberHasanov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3ddf36f1e47b83309f812c9d8c14939217413830 -
Trigger Event:
push
-
Statement type: