Skip to main content

No project description provided

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 via PrioritySelectedProjectsRepository: 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 (a file:// 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
  repo size:    2.8 KiB
  referenced:   2.0 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.

File size and upload time are recorded in the File model and appear in the JSON representation. The HTML PEP 503 index does not carry a data-size attribute (that field is JSON-only in PEP 691), so it is not surfaced in the emitted HTML.

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


Download files

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

Source Distribution

simple_repository_generator-0.1.0.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

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

simple_repository_generator-0.1.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for simple_repository_generator-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0312eced342fd905b8272f1ca8f82d54b2f24b91b718b5b8e549bb5478e32716
MD5 469dc143e4d39f24c80eb4a435900087
BLAKE2b-256 b3e56e20e366e394399981988fcfd672ada815bc6fff8fbb41e8ca9fd13ee7f0

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on pelson/simple-repository-generator

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

File details

Details for the file simple_repository_generator-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_repository_generator-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dc8a717b96cb2a69e12f870f1d84a4eaefb8d996c73d855580037290f0870deb
MD5 359d6d3eefad3698129bd75473e32570
BLAKE2b-256 a477362481c1d69a2476203fa824919fedc15777c6ca56a126f60a186594f40e

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on pelson/simple-repository-generator

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