PyPI Browser is a web application for browsing the contents of packages on the Python Package Index.
You can view a live version which provides information about packages from pypi.org:
- Search page
- Package page for the
django
package - Archive browse page for the
Django-4.1.1-py3-none-any.whl
file - File viewing page for a random file from the same archive
It can also be deployed with a private PyPI registry as its target in order to be used for a company's internal registry.
You can see all uploaded package archives for a given package.
You can inspect a package archive's metadata and its contents.
You can display text files directly in your browser, with syntax highlighting and other features like line selection provided by fluffy-code.
Binary files can also be downloaded.
To run your own copy, install
pypi-browser-webapp
using
pip, then run the pypi_browser.app:app
ASGI application using any ASGI web
server (e.g. uvicorn).
You can set these environment variables to configure the server:
-
PYPI_BROWSER_PYPI_URL
: URL for the PyPI server to use (defaults tohttps://pypi.org
)For best results (i.e. most available metadata), choose the first option from this list which is supported by your PyPI registry:
-
If your registry supports PEP691 JSON "simple" indexes, specify your base registry URL with
/simple
appended (e.g.https://my-registry/simple
). -
If your registry supports the legacy pypi.org-compatible JSON API (e.g.
{registry}/pypi/{package}/json
), specify your base registry URL without a suffix (e.g.https://my-registry
). -
Otherwise, if your registry only supports the traditional HTML "simple" index, specify the registry URL with
/simple
at the end (e.g.https://my-registry/simple
).
-
-
PYPI_BROWSER_PACKAGE_CACHE_PATH
: Filesystem path to use for caching downloaded files. This will grow forever (the app does not clean it up) so you may want to usetmpreaper
or similar to manage its size.
pypi-browser is an ASGI app, and while it performs a lot of I/O (downloading and extracting packages on-demand), some effort has been made to keep all blocking operations off of the main thread. It should be fairly performant.
To build this project locally, you'll need to install
Poetry and run poetry install
.
Once installed, you can run
$ make start-dev
to run a copy of the application locally with hot reloading enabled.