Value Error due to headers format change/
See original GitHub issueHi @fabiobatalha,
It seems like crossref api has made some modifications in header format.
{'date': 'Mon, 26 Jul 2021 11:41:59 GMT', 'content-type': 'application/json', 'transfer-encoding': 'chunked', 'access-control-allow-origin': '*', 'access-control-allow-headers': 'X-Requested-With', 'vary': 'Accept-Encoding', 'content-encoding': 'gzip', 'server': 'Jetty(9.4.40.v20210413)', 'x-ratelimit-limit': '50', 'x-ratelimit-interval': '1s', 'x-rate-limit-limit': '50, 50', 'x-rate-limit-interval': '1s, 1s', 'permissions-policy': 'interest-cohort=()', 'connection': 'close'}
‘x-rate-limit-limit’: ‘50, 50’, ‘x-rate-limit-interval’: ‘1s, 1s’,
Running below code
from crossref.restful import Works
works = Works()
w1 = works.query('zika').sample(20)
for item in w1:
print(item["title"])
is giving following error:
Traceback (most recent call last):
File "/home/ankush/.config/JetBrains/PyCharm2021.1/scratches/crossref_scratch.py", line 6, in <module>
for item in w1:
File "/media/ankush/ContinentalGroun/workplace/open_source/crossrefapi/crossref/restful.py", line 264, in __iter__
result = self.do_http_request(
File "/media/ankush/ContinentalGroun/workplace/open_source/crossrefapi/crossref/restful.py", line 80, in do_http_request
self._update_rate_limits(result.headers)
File "/media/ankush/ContinentalGroun/workplace/open_source/crossrefapi/crossref/restful.py", line 43, in _update_rate_limits
self.rate_limits['X-Rate-Limit-Limit'] = int(headers.get('X-Rate-Limit-Limit', 50))
ValueError: invalid literal for int() with base 10: '50, 50'
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
How to correct a #VALUE! error - Microsoft Support
On the Formats tab, click Additional settings. Look for the List separator. If the List separator is set to the minus sign, change...
Read more >How do I fix the "Missing column headers" error message?
1 Open the import file in Excel. 2 Select everything (Ctrl + A). 3 In the Editing group under the Home tab, click...
Read more >How to fix the "Invalid Header" error for CSV uploads
This error is usually caused by formatting or white space changes in the header of the CSV file you're attempting to upload.
Read more >How to Troubleshoot and Fix Excel Pivot Table Errors
This error message might appear if one of the source data headings was changed from UPPER case to Proper case (or any other...
Read more >Are Excel table headers always converted to text? - Super User
I am understanding your question to mean that you have X-number of columns already headed with dates in the format of dddd, mmmm...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi @Ankush-Chander;
I have just pushed the workaround to master, can you check if it is working.
Related Issue in Crossref API repository : https://gitlab.com/crossref/issues/-/issues/1389