Generate a static PEP 503 HTML index from local directories of wheels and sdists, or from an existing HTTP simple index
Project description
simple-repository-generator
Generate a static PEP 503 HTML index from local directories of wheels and sdists, or from an existing HTTP simple index. The output tree is a plain set of files suitable for uploading to GitHub Pages, S3, or any other static host.
Built on simple-repository.
Install
pip install simple-repository-generator
CLI
simple-repository-generator [--output OUT] [--copy] [--force] SOURCE [SOURCE ...]
SOURCE: either a local directory (crawled recursively for wheels and sdists) or an HTTP simple-index URL. Multiple sources are collapsed viaPrioritySelectedProjectsRepository: the first source listed wins on conflicts.--output OUT: destination directory (default./build/simple-repo).--copy: copy distribution files into the output tree and rewrite hrefs to relative paths, producing a self-contained tree. Without--copy, hrefs point at the source (afile://URL for a local directory, or the upstream URL for an HTTP source).--force: allow writing into a non-empty output directory.
Local sources do not need to be pre-arranged: filenames are parsed per PEP 427 (wheels) and PEP 625 (sdists) to infer the project name, and files are grouped accordingly. Anything whose name doesn't parse is skipped.
Example
$ simple-repository-generator --copy dist/
Wrote simple index to build/simple-repo
sources: dist/
projects: 1
files: 2 (2.9 KiB total)
on disk: 13.7 KiB
Output tree:
build/simple-repo/
simple/
index.html # project list
some-project/
index.html # project page
packages/
some-project/
some_project-0.1.0-py3-none-any.whl
some_project-0.1.0-py3-none-any.whl.metadata # PEP 658 sidecar
some_project-0.1.0.tar.gz
Point pip or uv at the simple/ subdirectory. Any URL scheme pip
supports for --index-url works, including file:// for a local
sanity check (the path after file:// must be absolute):
pip install --index-url "file://$(pwd)/build/simple-repo/simple/" some-project
The output is a plain directory of static files, so it drops straight
into a GitHub Pages site, an S3 bucket, or anything served by
python -m http.server.
Metadata exposed to clients
The emitted project pages carry every attribute the source repository
provides: data-requires-python, data-yanked, data-gpg-sig. In
--copy mode the generator additionally wraps the source in
MetadataInjectorRepository, extracts each wheel's *.dist-info/METADATA
into a .metadata sidecar next to the copied wheel, and advertises
data-core-metadata="true" on the page, so pip and uv can resolve
dependencies without downloading the full wheel.
Without --copy the pages are passed through unchanged. In particular
data-core-metadata is not injected, because there is no matching
.metadata file to serve alongside the source URL.
The emitted HTML is also designed to be human-friendly to browse
directly, with file size, upload date and other metadata surfaced
outside the PEP 503 anchor set. Machine clients (pip, uv) only look at
the <a> elements, which stay strictly PEP 503 compliant.
Related tools
dumb-pypialso emits a static PEP 503 tree, but takes a pre-built JSON manifest of files and does not extract PEP 658 metadata sidecars.simple-repository-serverif you want a running server rather than a static snapshot.simpleindexandproxpiare other runtime options that route or proxy live indexes instead of baking a snapshot.- Rolling your own from a directory of wheels is easy until you want
PEP 658
.metadatasidecars, multi-source merging, or upstream attributes likedata-requires-python/data-yankedpreserved faithfully — which is what this tool exists to handle.
Possible future extensions
- A JSON simple-index emitter (PEP 691) for hosts that can serve the registered vendor MIME types (e.g. S3, nginx). Pip enforces MIME strictly, so this is unusable on GitHub Pages today.
- Allow-list / deny-list / merge composition on the CLI, once HTTP sources make config-file input worthwhile.
- Recording
data-size/ upload-time in whatever future PEP extends HTML with those attributes. - Incremental / retention-aware builds. Each run currently writes a fresh tree.
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 simple_repository_generator-0.2.1.tar.gz.
File metadata
- Download URL: simple_repository_generator-0.2.1.tar.gz
- Upload date:
- Size: 20.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f978024a8255ce2b38057dc90891a56286f5467fd5bab5fd801922ff13054723
|
|
| MD5 |
428e324a617d2d4cea47664e41ea83ef
|
|
| BLAKE2b-256 |
e3bc41bdb8ca5c4ead8b5246d31253b5ca2a27b612011594b57dbd0e7bb8ac38
|
Provenance
The following attestation bundles were made for simple_repository_generator-0.2.1.tar.gz:
Publisher:
publish.yml on pelson/simple-repository-generator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simple_repository_generator-0.2.1.tar.gz -
Subject digest:
f978024a8255ce2b38057dc90891a56286f5467fd5bab5fd801922ff13054723 - Sigstore transparency entry: 2135683321
- Sigstore integration time:
-
Permalink:
pelson/simple-repository-generator@bec3a8e81fd2c214b5bec6a25a68c9d6c2c1bec2 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/pelson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bec3a8e81fd2c214b5bec6a25a68c9d6c2c1bec2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file simple_repository_generator-0.2.1-py3-none-any.whl.
File metadata
- Download URL: simple_repository_generator-0.2.1-py3-none-any.whl
- Upload date:
- Size: 22.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dea30de3031d915cab80173ed2170d7c245777ef1ab1851d9f3cc618c053d141
|
|
| MD5 |
ce5b1a8bf1af3e5fbc2cfaecc0b48798
|
|
| BLAKE2b-256 |
575b1e0f84026a8aed9128bf497e5527b276803edc8e99aa9cc88897b362e980
|
Provenance
The following attestation bundles were made for simple_repository_generator-0.2.1-py3-none-any.whl:
Publisher:
publish.yml on pelson/simple-repository-generator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simple_repository_generator-0.2.1-py3-none-any.whl -
Subject digest:
dea30de3031d915cab80173ed2170d7c245777ef1ab1851d9f3cc618c053d141 - Sigstore transparency entry: 2135683376
- Sigstore integration time:
-
Permalink:
pelson/simple-repository-generator@bec3a8e81fd2c214b5bec6a25a68c9d6c2c1bec2 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/pelson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bec3a8e81fd2c214b5bec6a25a68c9d6c2c1bec2 -
Trigger Event:
release
-
Statement type: