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.2.tar.gz (7.6 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.2-py2.py3-none-any.whl (7.7 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

Hashes for pip_json-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9bae9bcd47aa47018795b7dd814d1acae56e794c9797dba3ec51b2b23b01761b
MD5 6bbc1c986135326d4af558bb00986d65
BLAKE2b-256 342d1489311af2f5f9bb2d1ba04a91b51c3480d4644eb7d60476d54cc112b1ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for pip_json-0.1.2.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.2-py2.py3-none-any.whl.

File metadata

  • Download URL: pip_json-0.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.7 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.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4125352ed9754822bf6b3be49e07438211ec2e7f4b9fd2b8cbf0811f73ec7c82
MD5 b09cb9fcadc094b0b7fa3fb858a3a77c
BLAKE2b-256 6d6a31bbac99ac136aab6bd4a9ff1e66c56cdee4666642e23601ccf935824d13

See more details on using hashes here.

Provenance

The following attestation bundles were made for pip_json-0.1.2-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