Comments (6)
Alright, now I finally get the error as well:
>>> from pybliometrics.scopus import CitationOverview
>>>
>>> identifier = ["10.1016/j.suc.2023.06.004"]
>>> co = CitationOverview(identifier, start="2023", id_type="doi")
>>> co.cc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/panther/.local/lib/python3.10/site-packages/pybliometrics/scopus/abstract_citation.py", line 44, in cc
cites = [int(d['$']) for d in doc['cc']]
File "/home/panther/.local/lib/python3.10/site-packages/pybliometrics/scopus/abstract_citation.py", line 44, in <listcomp>
cites = [int(d['$']) for d in doc['cc']]
TypeError: string indices must be integers
Give me a little time to think about your proposed solution.
from pybliometrics.
I really wonder how you get that result. The CitationOverview()
class needs the Scopus IDs (not even EIDs work). So try this please:
identifier = ["84861986826"]
co = CitationOverview(identifier, start=2012)
print(co.cc)
# [[(2012, 2), (2013, 11), (2014, 15), (2015, 15), (2016, 25), (2017, 41), (2018, 56), (2019, 53), (2020, 46), (2021, 63), # (2022, 56), (2023, 51)]]
If you only have DOIs, use the AbstractRetrieval()
first. Will also deliver the publication year, for the start
parameter.
Interestingly, when I use your DOI, I get a pybliometrics.scopus.exception.Scopus404Error: The resource specified cannot be found.
from pybliometrics.
Thanks for your reply!!
Behavior of CitationOverview class.
First, we can use DOIs on Scopus CitationOverview API.
- query params
- doi | xsd:string | One or more document identifiers can be requested.
https://dev.elsevier.com/documentation/AbstractCitationAPI.wadl
- doi | xsd:string | One or more document identifiers can be requested.
And, I think I can use DOIs params on pybliometrics code.
Because, you implement that id_type parameter on the code.
I can select doi by id_type param.
https://github.com/pybliometrics-dev/pybliometrics/blob/master/pybliometrics/scopus/abstract_citation.py#L192-L212
def __init__(
...
id_type: str = "scopus_id",
....
) -> None:
"""Interaction witht the Citation Overview API.
...
:param id_type: The type of the IDs provided in `identifier`. Must be
one of "scopus_id", "doi", "pii", "pubmed_id".
...
# Get file content
...
kwds.update({id_type: identifier})
...
Retrieval.__init__(
self, stem, api="CitationOverview", date=date, citation=citation, **kwds
)
Scopus404Error
Interestingly, when I use your DOI, I get a pybliometrics.scopus.exception.Scopus404Error: The resource specified cannot be found.
Thanks for checking it out.
I guess that new articles in less well-known journals may experience periods of unregistration...
Code change request
If my code change request is not accepted, no problem, don't worry about it.
In that case, I will include the code to handle this specific error in my code.
Your wonderful library has helped me a lot and I am very grateful!!
regards.
Thank you.
from pybliometrics.
Hi again! I'm always happy for code changes by the pybliometics community, but I still fail to see the very problem your proposal wants to solve.
With
from pybliometrics.scopus import CitationOverview
identifier = ["10.1016/j.suc.2023.06.004"]
co = CitationOverview(identifier, start="2023")
I get the pybliometrics.scopus.exception.Scopus404Error: The resource specified cannot be found.
I already mentioned above. So I don't see how handling a TypeError, in addition to an AttributeError in CitationOverview().cc
deals with this.
And sorry for the confusion with the DOIs, you're of course right that CitationOverview()
accepts DOIs.
from pybliometrics.
Thanks for discuss!
I misunderstood your Scopus404Error comment, sorry.
When I use doi as dentifier, I specify doi as id_type.
from pybliometrics.scopus import CitationOverview
identifier = ["10.1016/j.suc.2023.06.004"]
co = CitationOverview(identifier, start="2023", id_type="doi")
from pybliometrics.
Thank you very much for code change!
from pybliometrics.
Related Issues (20)
- Easy way to set up "portable" behavior HOT 5
- Errors in citescoreyearinfolist HOT 1
- ScopusSearch by DOI produces different results if space added HOT 2
- LitStudy - Scopus400 Error: Exceeds the maximum number allowed for the service level HOT 2
- What is the Scopus search link? HOT 3
- __str__ not always working HOT 1
- 'No Edges Given' on Network Analysis
- 'ENTITLED' view is not supported HOT 2
- Improper 404 error HOT 2
- Implement init() function to replace execution of code on import HOT 2
- Fix tests HOT 3
- Move creating folder from `get_folder()` to `init()` HOT 2
- Check valid views with new `VIEWS` constant
- Scopus401Error: The requestor is not authorized to access the requested view or fields of the resource HOT 1
- CitationOverview's cc property unexpected Error. HOT 7
- Lookup quota reset time after depletion? HOT 4
- AffiliationSearch: parent affiliation id is always "0" HOT 1
- AttributeError with AbstractRetrieval(..., view="REF").references
- AbstractRetrieval(..., view="REF") sometimes breaks when there are no references
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 pybliometrics.