Skip to content

Commit

Permalink
Merge pull request #12 from cicirello/i100-i1000-etc
Browse files Browse the repository at this point in the history
Added i100, i1000, i10000 indexes
  • Loading branch information
cicirello authored Jul 16, 2022
2 parents 1c17803 + 96563e7 commit bc74a5e
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 16 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased] - 2022-06-30
## [Unreleased] - 2022-07-16

### Added

Expand All @@ -19,6 +19,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### CI/CD


## [2.1.0] - 2022-07-16

### Added
* Calculation of i100-index, i1000-index, and i10000-index, with inclusion in SVG for any of
these that are greater than 0.


## [2.0.0] - 2022-06-30

**BREAKING CHANGES** Entry point has changed--now runs as a module rather than a script.
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This command line utility does the following:
* retrieves the first page of your Google Scholar profile;
* parses from that page your total citations, your five-year citation count, your h-index, your i10-index, and the number of citations of your most-cited paper;
* computes your g-index provided if it is less than 100 ([reason for limitation later](#respect-google-scholars-robotstxt));
* computes your i100-index, i1000-index, and i10000-index ([doi:10.1007/s11192-020-03831-9](https://doi.org/10.1007/s11192-020-03831-9)), hiding any that are 0, and provided they are less than 100 ([reason for limitation later](#respect-google-scholars-robotstxt));
* generates a JSON file summarizing these bibliometrics; and
* generates one or more SVG images summarizing these bibliometrics.

Expand Down Expand Up @@ -50,12 +51,13 @@ Here is a sample of the JSON summary also generated by the utility:

```JSON
{
"fiveYear": 376,
"g": 45,
"fiveYear": 364,
"g": 44,
"h": 25,
"i10": 33,
"i100": 3,
"most": 228,
"total": 2064
"total": 2052
}
```

Expand Down Expand Up @@ -162,8 +164,8 @@ py -m bibliometrics
## Respect Google Scholar's robots.txt

If you use this utility, please respect Google Scholar's robots.txt. The reason that the
g-index is only computed by this utility if it is less than 100 derives from Scholar's
robots.txt. Here is the relevant excerpt:
g-index (as well as i100-index, i1000-index, i10000-index) is only computed by this utility
if it is less than 100 derives from Scholar's robots.txt. Here is the relevant excerpt:

```robots.txt
Allow: /citations?user=
Expand Down
7 changes: 4 additions & 3 deletions bibliometrics.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"fiveYear": 376,
"g": 45,
"fiveYear": 364,
"g": 44,
"h": 25,
"i10": 33,
"i100": 3,
"most": 228,
"total": 2064
"total": 2052
}
2 changes: 1 addition & 1 deletion images/bibliometrics.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion images/bibliometrics2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "bibliometrics"
version = "2.0.0"
version = "2.1.0"
authors = [
{ name="Vincent A. Cicirello", email="development@cicirello.org" },
]
Expand All @@ -25,10 +25,14 @@ keywords = [
"g-index",
"h-index",
"i10-index",
"i100-index",
"i1000-index",
"i10000-index",
"journals",
"publications",
"researcher",
"scholar",
"scientometrics",
"SVG",
"SVG generation",
]
Expand Down
20 changes: 16 additions & 4 deletions src/bibliometrics/bibliometrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ def generateBibliometricsImage(metrics, colors, titleText) :
("Most-cited paper", "most"),
("h-index", "h"),
("i10-index", "i10"),
("i100-index", "i100"),
("i1000-index", "i1000"),
("i10000-index", "i10000"),
("g-index", "g")
]

Expand Down Expand Up @@ -226,14 +229,20 @@ def parseBibliometrics(page) :
return metrics
i10 = page[startStat+1:endStat]
metrics["i10"] = int(i10.strip())
g, most = calculateMostAndG(page)
g, most, i100, i1000, i10000 = calculate_additional(page)
if g > 0 and g < 100 :
metrics["g"] = g
if most > 0 :
metrics["most"] = most
if i100 > 0 and i100 < 100 :
metrics["i100"] = i100
if i1000 > 0 and i1000 < 100 :
metrics["i1000"] = i1000
if i10000 > 0 and i10000 < 100 :
metrics["i10000"] = i10000
return metrics

def calculateMostAndG(page) :
def calculate_additional(page) :
"""Calculates the g-index and the most cited paper.
Keyword arguments:
Expand All @@ -243,11 +252,14 @@ def calculateMostAndG(page) :
if len(citesList) > 0 :
citesList.sort(reverse=True)
most = citesList[0]
i100 = sum(1 for x in citesList if x >= 100)
i1000 = sum(1 for x in citesList if x >= 1000)
i10000 = sum(1 for x in citesList if x >= 10000)
for i in range(1, len(citesList)) :
citesList[i] = citesList[i] + citesList[i-1]
citesList = [ (i+1, x) for i, x in enumerate(citesList) ]
return max(y for y, x in citesList if x >= y*y), most
return 0, 0
return max(y for y, x in citesList if x >= y*y), most, i100, i1000, i10000
return 0, 0, 0, 0, 0

def parseDataForG(page) :
"""Parses the cites per publication for calculating g-index
Expand Down
5 changes: 5 additions & 0 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,17 @@ def test_parse(self) :
self.assertEqual(33, metrics["i10"])
self.assertEqual(44, metrics["g"])
self.assertEqual(228, metrics["most"])
self.assertEqual(3, metrics["i100"])
self.assertFalse("i1000" in metrics)
self.assertFalse("i10000" in metrics)

def test_generate_image(self) :
metrics = {
"total" : 2052,
"fiveYear" : 364,
"h" : 25,
"i10" : 33,
"i100" : 3,
"g" : 44,
"most" : 228
}
Expand Down Expand Up @@ -81,3 +85,4 @@ def test_generate_image(self) :
if TestBibiometrics.printSampleImage :
bib.outputImage(image, "images/bibliometrics2.svg")
bib.outputImage(image2, "images/bibliometrics.svg")
bib.outputJSON("bibliometrics.json", metrics)

0 comments on commit bc74a5e

Please sign in to comment.