# PyPI mirror (pkg.shecan.ir)

> Mirror of the PyPI Simple index (pypi.org) for pip, uv and Poetry.

- Upstream: pypi.org
- Mirror URL: <https://mirror-pypi.pkg.shecan.ir/simple/>
- Clients: pip, uv, poetry
- Service status: <https://pkg.shecan.ir/status.json> (key `pypi`; up/down, refreshed every minute)
- Guide (Persian, HTML): <https://pkg.shecan.ir/mirrors/pypi/>
- JSON: <https://pkg.shecan.ir/api/v1/mirrors/pypi.json>
- Integrity comparison with the official source (audit.shecan.ir, also run by Shecan, open source; group `pypi`, mirror `shecan`): <https://audit.shecan.ir/#pypi>

## Limitations

- Only the Simple API (PEP 503 and PEP 691) is served; search, the JSON API and uploads (twine) are not available.
- Hash-checking installs (--require-hashes) and PEP 658 metadata are supported.

## Setup

Every block below is the exact text of the Persian guide. Unless marked otherwise it is run against the live mirror in a disposable container on every catalog change; "checked by hand" blocks cannot run in a container. Change a machine only with its owner's permission: back up existing configuration first, merge into existing files instead of overwriting them, and keep the "Undo" step at hand.

### pip: temporary (one command or the current shell; nothing saved)

Run

```sh
pip install --index-url https://mirror-pypi.pkg.shecan.ir/simple/ humanize
```

Run, Environment variable for the shell session (CI, Dockerfile) (linux, macos)

```sh
export PIP_INDEX_URL=https://mirror-pypi.pkg.shecan.ir/simple/
```

Run, Environment variable for the shell session (CI, Dockerfile) (windows)

```powershell
$env:PIP_INDEX_URL = "https://mirror-pypi.pkg.shecan.ir/simple/"
```

### pip: persistent (user- or system-wide configuration)

Run

```sh
pip config set global.index-url https://mirror-pypi.pkg.shecan.ir/simple/
```

Undo / restore the default

```sh
pip config unset global.index-url
```

Configuration file, Configuration file (linux, windows): `%APPDATA%\pip\pip.ini` or `~/.config/pip/pip.conf`

```ini
[global]
index-url = https://mirror-pypi.pkg.shecan.ir/simple/
```

### uv: temporary (one command or the current shell; nothing saved)

Run, Environment variable for the shell session (linux, macos)

```sh
export UV_DEFAULT_INDEX=https://mirror-pypi.pkg.shecan.ir/simple/
```

Run, Environment variable for the shell session (windows)

```powershell
$env:UV_DEFAULT_INDEX = "https://mirror-pypi.pkg.shecan.ir/simple/"
```

Run

```sh
uv pip install --system --index-url https://mirror-pypi.pkg.shecan.ir/simple/ humanize
```

### uv: project (files inside the project)

Configuration file: `pyproject.toml`

```toml
[[tool.uv.index]]
url = "https://mirror-pypi.pkg.shecan.ir/simple/"
default = true
```

### poetry: project (files inside the project)

Run

```sh
poetry source add --priority=primary shecan https://mirror-pypi.pkg.shecan.ir/simple/
```

Undo / restore the default

```sh
poetry source remove shecan
```
