Metadata-Version: 2.4
Name: dyp
Version: 0.2.0
Summary: A pip wrapper with a dnf5-style interface and a scriptable API
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: Environment :: Console
Classifier: Topic :: System :: Software Distribution
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: packaging>=23.0

# dyp

A pip wrapper that looks and feels like `dnf5` — and a small scriptable API underneath.

```
$ dyp install requests
Updating and loading repositories:
 PyPI - pypi.org                                      100% | 183.3 KiB/s | 227.1 KiB |  00m01s
Repositories loaded.
Package             Arch       Version      Repository       Size
Installing:
 requests           noarch     2.34.2       pypi         71.4 KiB
Installing dependencies:
 certifi            noarch     2026.10.23   pypi        131.9 KiB
 ...
Transaction Summary:
 Installing:         5 packages

Total size of inbound packages is 655 KiB. Need to download 655 KiB.
Is this ok [y/N]:
```

dyp **never calls pip**. It has its own engine:

* **index client**: PEP 691 JSON (HTML fallback), PEP 658 metadata and PEP 700 sizes, keep-alive
  connections (also through HTTPS proxies), ETag-validated disk cache.
* **resolver**: backtracking, PEP 440 versions, PEP 508 markers, extras, forward checking.
  Dependency pages are fetched in parallel the moment they are discovered.
* **downloads**: 3 at a time, resumable, sha256-verified, cached.
* **installer**: unpacks wheels in-process, writes `RECORD`/`INSTALLER`/`REQUESTED`, creates console
  scripts, and uninstalls from `RECORD`. Wheels only (no source builds).

It targets the **active virtualenv** (`VIRTUAL_ENV`), or any interpreter via `--python`.

## Commands

| command | what it does |
|---|---|
| `dyp install PKG... [-r reqs.txt] [-U] [--pre] [--index-url URL]` | resolve, download, install |
| `dyp upgrade [PKG...]` | upgrade the named packages, or everything installed |
| `dyp check-update` | list newer releases (exit code 100 if any, like dnf) |
| `dyp remove PKG...` | uninstall via RECORD (refuses `pip` / `dyp` / `packaging`) |
| `dyp list [FILTER...]` | installed packages |
| `dyp clean` | empty the download cache |

Common flags: `-y`, `--dry-run`, `--python PATH` (target another interpreter/venv), `--user`.
`NO_COLOR=1` disables color. Downloads are cached in `~/.cache/dyp` (`%LOCALAPPDATA%\dyp` on Windows).

## API

```python
import dyp

env = dyp.Env.load()                        # or Env.load(r"C:\proj\.venv\Scripts\python.exe")
index = dyp.Index(env)
pkgs = dyp.resolve(["requests"], env=env, index=index)      # [Package], dependencies first

dyp.Session(pkgs, parallel=3, on_event=print).run()         # Event(kind, name, done, total, rate)
for p in pkgs:
    dyp.install_wheel(p.path, env, requested=p.requested)

dyp.check_updates(env, index)               # [(Dist, newest Version)]
dyp.scan(env)                               # installed distributions
```

## Speed (measured, same sandbox, pip 26.3)

* resolve with warm caches: about 2x faster than pip
* resolve + install 22 wheels (pandas, matplotlib, numpy, ...) from local files: 4.9 s vs 8.6 s
* cold network: no consistent win; that is dominated by the connection

## Not done yet

* source distributions / building from source
* Windows launchers are `name.cmd` + `name-script.py`, not `.exe`
* bytecode is not pre-compiled at install time
* `info`, `search`, `history`; removing now-unneeded dependencies
* direct URL / VCS requirements
