Comments (3)
Hi Christophe,
Thanks for catching this unintuitive behavior!
Could you explain a bit more your workflow regarding setting/updating tokens? setting ads.config.token
was meant as a one-time initialization step in the same way as setting environmental variables or writing to those config files. One can always make the query object and set the token on that directly after instantiation:
query = ads.SearchQuery(q='q')
q.token = 'token'
but maybe there's a better way for your use case that we can support.
from ads.
Hi Vladimir,
For unknown reasons, in the print_results in my program (https://github.com/Morisset/SNI_ads), when I use some methods of papers objects (still don't know which one), it calls ADS. It should not, as all the values have been downloaded in previous stage and this method is only a printing one. I also realized that the program is working very well without any connection (this goes in the direction that everything was known before entering this method), so when entering the method I store the token in some variable and then do
ads.config.token = ''
The rest of the program runs and at the end I reset the token to the original value. But I realized that when I have the ADS_DEV_KEY environment variable defined, it does not take into account the trick and connect to ADS, burning some of the 5000 tickets/day I have. It may be an is one print a lot of time.
I was thinking that the token from ads.config was a variable (or even a property) and that changing its value would change the behavior.
from ads.
For the reasons stated above and that it seems your issue's root cause was issue #38, I won't be refactoring ads.config.token
. I've added a optional token
kwarg to the SearchQuery
constructor that will set the token at init. I think that should be fine for workflows that require changing tokens frequently.
from ads.
Related Issues (20)
- `ads.SearchQuery` returns a status 500 APIResponseError HOT 6
- SearchQuery not respecting start parameter HOT 27
- docs: link to available search field needs updating HOT 3
- author_count return None HOT 3
- How do you search on a range of years? HOT 1
- citation_count returns None HOT 2
- Missing paper.journal attribute HOT 1
- Missing .adsurl attribute HOT 1
- API Response Error HOT 2
- Search parameters wrapped in parentheses should not be auto-quoted
- readthedocs rendering is broken HOT 2
- support for Positional Field Searches HOT 1
- ExportQuery not working properly HOT 1
- Not able to use timeAllowed and cursorMark combination HOT 1
- Why is the total number of filtered articles and citation_count cumulative number inconsistent with manual searches? HOT 1
- API Response Error while running example HOT 1
- search using both cursorMark and timeAllowed HOT 8
- All queries fail with SSLError HOT 8
- Feature Request: search by arxiv-id HOT 7
- Non-lazy loading leads to missing properties in SeachQuery HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ads.