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 (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.

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.2.0.tar.gz (19.5 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.2.0-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for simple_repository_generator-0.2.0.tar.gz
Algorithm Hash digest
SHA256 60ff7941a2a0a9a3f6cf73d5c8a66774d19bd2421c4e88beec55aa0eccaa46ff
MD5 5baa4010e99ee8c8856e97c1ed21deb5
BLAKE2b-256 7437ff386873ebbd4edb3231ca7777067ade284def315f7f447605b8758ad4b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_repository_generator-0.2.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.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_repository_generator-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3fc54873d143a5fa3590cc7712bc06f2f8b856d075e25d0078c57abb6533d878
MD5 94e51d632138e11eb423fffbdfc9c405
BLAKE2b-256 a0ff2d340deb48fe1cd3f4242ff1212969f30157fa4a742ac32de1b45492603c

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_repository_generator-0.2.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