devpi-common

4.1.1 · active · verified Thu Apr 16

devpi-common is a utility library providing common functionalities like URL handling, metadata parsing, and archive management. It is primarily used by devpi-server and devpi-client to ensure consistent behavior across the devpi ecosystem. The current version is 4.1.1, with releases often coinciding with major devpi component updates, typically several times a year.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to use the `devpi_common.url.URL` object for parsing, manipulating, and composing URLs, which is one of the core utilities provided by the library.

from devpi_common.url import URL

# Create a URL object
url_obj = URL('https://pypi.org/project/devpi-common/4.1.1/')
print(f"Original URL: {url_obj}")

# Access parts of the URL
print(f"Scheme: {url_obj.scheme}")
print(f"Netloc: {url_obj.netloc}")
print(f"Path: {url_obj.path}")

# Join paths
new_url = url_obj.joinpath('../pypi')
print(f"Joined URL: {new_url}")

# Create a URL from components
composed_url = URL(scheme='http', netloc='localhost:3141', path='/root/pypi/')
print(f"Composed URL: {composed_url}")

view raw JSON →