Skip to main content

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-json from 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


Download files

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

Source Distribution

pip_json-0.1.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pip_json-0.1.0-py2.py3-none-any.whl (7.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pip_json-0.1.0.tar.gz.

File metadata

  • Download URL: pip_json-0.1.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pip_json-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d31b059ec97b1458a0ce56f03a8e780d2426b6abc87e695f5062775df57fde8d
MD5 da039ec22910d0915764e9d595565ea3
BLAKE2b-256 4d9961c9c745db5da86f3a0f047c721f34b8c2d4941f3d17ee1891e5cdc8d0ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for pip_json-0.1.0.tar.gz:

Publisher: publish.yml on EkberHasanov/pip-json

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pip_json-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pip_json-0.1.0-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

Hashes for pip_json-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f8e04a3a4b54734ad92f143cfd53ff45553d254391e4414ddbd9534f79a6a6c9
MD5 12f1fe2a2b0039622167c907a25f485e
BLAKE2b-256 a4a9be70efbccdfc0638192db54d17b6e5fbd23b04689049f2280744323b1ce6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pip_json-0.1.0-py2.py3-none-any.whl:

Publisher: publish.yml on EkberHasanov/pip-json

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page