What does the "weight" of PyPI search results mean when choosing a package?

When I look for “XML parsing” in PyPI , consistent results are listed according to “weight”. When I hover over the "weight", it says "the appearance of a search term, weighted by field (name, resume, keywords, description, author, maintainer)."

  • What does "field-weighted (name, resume, keywords, description, author, maintainer)" mean?

  • Ideally, does a package really take a higher place than better than the package below?

Thank.

+4
source share
2 answers

! pypi repository "", :

./templates/index.pt:15: <th tal:condition="exists:data/scores"><u title="Occurrence of search term weighted by field (name, summary, keywords, description, author, maintainer)">Weight*</u></th>

"", search. , :

    columns = [
        ('name', 4),      # doubled for exact (case-insensitive) match
        ('summary', 2),
        ('keywords', 2),
        ('description', 1),
        ('author', 1),
        ('maintainer', 1),
    ]

, , 4, , 2 .. , .

"XML parse" Products.ParsedXML. :

  • : " .ParsedXML" = 4 + 4 = 8
  • : " XML ..." = 2 + 2 = 4
  • : "parsedxml xml zope2" = 2 + 2 = 4
  • : " XML ..." = 1 + 1 = 2
  • : " " = 0
  • : () = 0
  • = 8 + 4 + 4 + 2 + 0 + 0 = 18

18 - .

, , , (AKA "" "). , . , , . , , , , .

+4
jobskills = {'java': 10, 'python': 20, 'jquery': 5}

candidateskills = ['python', 'java','angular']

foundskills={k:jobskills[k] for k in candidateskills if k in jobskills}

print sum(foundskills.values())
-2

All Articles