{% extends "base.html" %} {% from "_macros.html" import icon, copy_button, source_marks %} {% block main %} {% set cmd_base = 'pip install --index-url ' ~ pip_index_url ~ ((' --trusted-host ' ~ trusted_host) if trusted_host else '') %}

Python packages, served locally.

Packages you upload are hosted here. Anything else is fetched from PyPI the first time it is installed, then kept on this server.

{{ cmd_base }} package-name {{ copy_button('cmd-main') }}

Packages

{% if snapshot.packages %}

{{ '{:,}'.format(snapshot.packages|length) }} package{{ '' if snapshot.packages|length == 1 else 's' }}, {{ '{:,}'.format(snapshot.total_files) }} file{{ '' if snapshot.total_files == 1 else 's' }}, {{ snapshot.total_size|filesize }} on disk

{% endif %}
{% if snapshot.packages %}
{% endif %}
{% if snapshot.packages %}
{% for p in snapshot.packages %} {% endfor %}
Packages stored on this server
Version Source
{{ p.name }} {{ p.latest or '–' }} {{ source_marks(p.sources) }} {{ p.files|length }} {{ p.total_size|filesize }}
{% else %}
{{ icon('inbox', 'empty__icon') }}

Nothing is stored here yet

Upload a package with twine, or install anything through this index. Packages found on PyPI are cached on first use.

See how to use this index

{% endif %}

Use this index

Point pip at this server once, and every install goes through it.

pip config set global.index-url {{ pip_index_url }}{% if trusted_host %} pip config set global.trusted-host {{ trusted_host }}{% endif %}{{ copy_button('code-pip-config') }}

To use it for a single install instead:

{{ cmd_base }} package-name{{ copy_button('code-pip-once') }}

Uploads need an account on this server. An administrator can create one with pypihub user -u NAME on the server.

twine upload --repository-url {{ base_url }}/ --username your-username dist/*{{ copy_button('code-twine') }}

Or save the server in ~/.pypirc and upload by name:

[distutils] index-servers = pypihub [pypihub] repository = {{ base_url }}/ username = your-username{{ copy_button('code-pypirc') }}
twine upload --repository pypihub dist/*{{ copy_button('code-twine-name') }}

Send one file to /upload/<package>/. curl asks for the password.

curl -u your-username -F "file=@dist/package_name-1.0.0-py3-none-any.whl" {{ base_url }}/upload/package-name/{{ copy_button('code-curl') }}
{% endblock %}