Git Product home page Git Product logo

Comments (2)

arunkannawadi avatar arunkannawadi commented on May 20, 2024 1

Some search_ functions already return this that are accessbile via the total_results attribute. I don't remember off the top of my head if search_keyboard returns this or not. See here for examples:

scholarly/test_module.py

Lines 735 to 750 in 9269ff3

def test_search_pubs_total_results(self):
"""
As of September 16, 2021 there are 32 pubs that fit the search term:
["naive physics" stability "3d shape"], and 17'000 results that fit
the search term ["WIEN2k Blaha"] and none for ["sdfsdf+24r+asdfasdf"].
Check that the total results for that search term equals 32.
"""
pubs = scholarly.search_pubs('"naive physics" stability "3d shape"')
self.assertGreaterEqual(pubs.total_results, 32)
pubs = scholarly.search_pubs('WIEN2k Blaha')
self.assertGreaterEqual(pubs.total_results, 10000)
pubs = scholarly.search_pubs('sdfsdf+24r+asdfasdf')
self.assertEqual(pubs.total_results, 0)

from scholarly.

dlebedinsky avatar dlebedinsky commented on May 20, 2024

I just tested it out, and search_keyword does not have total_results implemented. I think it's because search_keyword does not return a SearchScholarIterator, unlike search_pubs.
Based on the WIEN2k Blaha example, it looks like search_pubs will get all publications that have the search term in their title, not just exact matches, right? For now, I will use that as a substitute for search_keyword(...).total_results in my project. Thanks for pointing those tests out.
2023-11-21-180447_986x499_scrot

from scholarly.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.