distlib icon indicating copy to clipboard operation
distlib copied to clipboard

Add `urls` property

Open KOLANICH opened this issue 3 years ago • 0 comments

The proposed impl is kinda

def urls(self):
    md = self.todict()
    try:
        pUrls = dict(el.split(", ") for el in md['project_url']) 
    except KeyError:
        pUrls = {}

    pUrls = dict(el.split(", ") for el in md['project_url'])
    hUrls = {}
    for k in ('home_page', "download_url"):
        v = md.get(k, None)
        if v:
            hUrls[k] = v

    return pUrls, hUrls

(though it is inefficient to use self.todict(), it should be refactored)

KOLANICH avatar Feb 12 '23 17:02 KOLANICH