code: def from_href(cls, href, **kw):
      
      package = cls._HREF_TO_PACKAGE_CACHE.get(href)
      if package is not None:
        return package
      link_href = Link.wrap(href)
      for package_type in cls._REGISTRY:
        try:
          package = package_type(link_href.url, **kw)
          break
        except package_type.InvalidPackage:
          continue
      if package is not None:
        cls._HREF_TO_PACKAGE_CACHE.store(href, package)
      return package
docs: Convert from a url to Package.
  
      :param href: The url to parse
      :type href: string
      :returns: A Package object if a valid concrete implementation exists, otherwise None.