Skip to main content

The core simple repository (PEP-503) interface, including powerful component implementations suitable for use in repository clients and servers

Project description

simple-repository

The core simple repository (PEP-503) interface, including powerful component implementations suitable for use in repository clients and servers.

About

The simple-repository core library provides a base SimpleRepository class, with interfaces for each of the endpoints of the PEP-503 simple repository, namely get_project_list and get_project_page. Furthermore, it exposes an interface for resource retrieval (get_resource), offering the possibility to dynamically control the entire repository interaction from tools such as pip.

Subclasses of the SimpleRepository, commonly referred to as repository "components", are free to specialise the repository behaviour according to their function. Components may contain other components, and in doing so, a directed acyclic graph of repositories can be built-up:

example project page

The resulting SimpleRepository allows repository consumers (either clients or servers) to query the "virtual repository" definition as if it were a traditional file or http based repository.

Some of the implemented components in this repository include:

  • HTTPRepository: represents a http-based PEP-503 compatible simple repository
  • LocalRepository: represents a directory containing many project directories, each with its own files/distributions
  • PrioritySelectedProjectsRepository: represents the combination of an ordered set of repositories, merged such that when choosing a project, the first repository to contain the project will be used. This component is designed to mitigate the dependency confusion attack.
  • MetadataInjectorRepository: with the advent of PEP-658, installers no longer need to download the whole distribution in order to determine a project's metadata (e.g. its dependencies). This repository will compute the metadata on the fly by inspecting the distribution (e.g. a wheel). The component allows downstream consumers (both clients and servers) to assume the existence of metadata, even though the originating repository may not itself provide any.
  • AllowListedRepository: represents a repository which only permits projects to be accessed from a defined list of allowed projects.

There are many such components in this library. In the case that a desired component doesn't already exist, implementing a new one is a matter of implementing a small number of methods. The resulting implementations are reusable, concise, and are easy to validate and test.

Known usage

Here are some of the known uses of the simple-repository core library:

  • simple-repository-server: A tool for running a PEP-503 simple Python package repository, including features such as dist metadata (PEP-658) and JSON API (PEP-691)
  • simple-repository-browser: A web interface to browse and search packages in any simple package repository (PEP-503), inspired by PyPI / warehouse
  • pypi-timemachine: Install packages with pip as if you were in the past! pypi-timemachine allows you to see a package repository as it would have been at any given time

If you know of other uses of simple-repository, please submit a PR to add them to the list.

License and Support

This code has been released under the MIT license. It is an initial prototype which is developed in-house, and not currently openly developed.

It is hoped that the release of this prototype will trigger interest from other parties that have similar needs. With sufficient collaborative interest there is the potential for the project to be openly developed, and to power Python package repositories across many domains.

Please get in touch at https://github.com/orgs/simple-repository/discussions to share how this project may be useful to you. This will help us to gauge the level of interest and provide valuable insight when deciding whether to commit future resources to the project.

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-0.11.1.tar.gz (112.9 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-0.11.1-py3-none-any.whl (86.3 kB view details)

Uploaded Python 3

File details

Details for the file simple_repository-0.11.1.tar.gz.

File metadata

  • Download URL: simple_repository-0.11.1.tar.gz
  • Upload date:
  • Size: 112.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for simple_repository-0.11.1.tar.gz
Algorithm Hash digest
SHA256 283072410aea0935b88b5b13d8aa0ee377355adc94a610a47f25e9ebe94a639f
MD5 d656adcdb54921a8899197614511ed38
BLAKE2b-256 8e87d2c1f828b12dc482c6d577c85994c2ad5fdb256a1ed04431e420fd4384e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_repository-0.11.1.tar.gz:

Publisher: python-publish.yml on simple-repository/simple-repository

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-0.11.1-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_repository-0.11.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3a4c659efa5551d98ab8b700285e6146a569c618b4142756d822e123800510ff
MD5 7adc5b1ce78e9e5e17ba25e1a61d0517
BLAKE2b-256 a019be9ae9fa10765f2620da2c7973a38f4c3c5edf8998ddbfe618706c3b5604

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_repository-0.11.1-py3-none-any.whl:

Publisher: python-publish.yml on simple-repository/simple-repository

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