Code Monkey home page Code Monkey logo

Comments (7)

arunkannawadi avatar arunkannawadi commented on June 10, 2024

Could you expand a bit more on the use case? Are you suggesting that if you repeat a query, scholarly should return cached results instead of running the query again, or if a query returns results that have been previously returned from a different query (and filled say), it should fill the information from the cached results?

from scholarly.

tigerjack avatar tigerjack commented on June 10, 2024

Could you expand a bit more on the use case? Are you suggesting that if you repeat a query, scholarly should return cached results instead of running the query again, or if a query returns results that have been previously returned from a different query (and filled say), it should fill the information from the cached results?

I guess both of them are valid ideas, but the first seems more immediate. pybliometrics, for example, takes the results from the cache unless the user specifically force an update. I guess there's also an expire date for the cached results, but I am not sure about it.

For the use case, even testing some user scripts often requires a lot of time, since the results should be fetched every time from the web.

from scholarly.

arunkannawadi avatar arunkannawadi commented on June 10, 2024

OK, having something like a 24-hour expiration for cached results would make sense. I don't have a timeline for this feature, but would welcome a PR from the community.

from scholarly.

ltalirz avatar ltalirz commented on June 10, 2024

It's actually very easy to do this with requests_cache (no changes needed in scholarly)

See the "patching" approach where requests_cache simply monkeypatches all calls to the requests library

https://requests-cache.readthedocs.io/en/stable/#patching

from scholarly.

anapaulagomes avatar anapaulagomes commented on June 10, 2024

I did this @ltalirz but it didn't work. The cache is installed but no URLs are returned. Did you try this out or have an example to show? Thank you!

Update: I just saw where the requests are happening :)

from scholarly.

ltalirz avatar ltalirz commented on June 10, 2024

Cheers, so it does work for you as well?

from scholarly.

anapaulagomes avatar anapaulagomes commented on June 10, 2024

No, it doesn’t. I haven’t look further

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.