scholarimpact 0.0.1.dev1__tar.gz → 0.0.2.dev2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/.gitignore +1 -1
  2. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/PKG-INFO +3 -3
  3. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/README.md +2 -2
  4. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/_version.py +2 -2
  5. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/dashboard/app.py +12 -0
  6. scholarimpact-0.0.2.dev2/src/scholarimpact/data/__init__.py +5 -0
  7. scholarimpact-0.0.2.dev2/src/scholarimpact/data/loader.py +131 -0
  8. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact.egg-info/PKG-INFO +3 -3
  9. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact.egg-info/SOURCES.txt +2 -2
  10. scholarimpact-0.0.1.dev1/example-dashboard.png +0 -0
  11. scholarimpact-0.0.1.dev1/research-domains.png +0 -0
  12. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/.github/workflows/cleanup-prereleases.yml +0 -0
  13. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/.github/workflows/release.yml +0 -0
  14. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/.github/workflows/test.yml +0 -0
  15. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/CITATION.cff +0 -0
  16. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/LICENSE +0 -0
  17. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/Makefile +0 -0
  18. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/pyproject.toml +0 -0
  19. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/requirements-dev.txt +0 -0
  20. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/requirements.txt +0 -0
  21. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/setup.cfg +0 -0
  22. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/__init__.py +0 -0
  23. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/assets/README.md +0 -0
  24. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/assets/__init__.py +0 -0
  25. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/assets/fonts/OFL-SpaceGrotesk.txt +0 -0
  26. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/assets/fonts/OFL-SpaceMono.txt +0 -0
  27. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/assets/fonts/SpaceGrotesk-SemiBold.ttf +0 -0
  28. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/assets/fonts/SpaceGrotesk-VariableFont_wght.ttf +0 -0
  29. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/assets/fonts/SpaceMono-Bold.ttf +0 -0
  30. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/assets/fonts/SpaceMono-BoldItalic.ttf +0 -0
  31. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/assets/fonts/SpaceMono-Italic.ttf +0 -0
  32. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/assets/fonts/SpaceMono-Regular.ttf +0 -0
  33. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/assets/streamlit/config.toml +0 -0
  34. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/cli/__init__.py +0 -0
  35. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/cli/commands/__init__.py +0 -0
  36. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/cli/commands/crawl.py +0 -0
  37. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/cli/commands/dashboard.py +0 -0
  38. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/cli/commands/extract.py +0 -0
  39. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/cli/commands/generate.py +0 -0
  40. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/cli/main.py +0 -0
  41. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/core/__init__.py +0 -0
  42. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/core/crawler.py +0 -0
  43. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/core/extractor.py +0 -0
  44. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/core/utils.py +0 -0
  45. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/dashboard/__init__.py +0 -0
  46. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/dashboard/components/__init__.py +0 -0
  47. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/dashboard/components/base.py +0 -0
  48. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/dashboard/components/config.py +0 -0
  49. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/dashboard/components/layout.py +0 -0
  50. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact/dashboard/components/streamlit_app.py +0 -0
  51. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact.egg-info/dependency_links.txt +0 -0
  52. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact.egg-info/entry_points.txt +0 -0
  53. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact.egg-info/requires.txt +0 -0
  54. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/src/scholarimpact.egg-info/top_level.txt +0 -0
  55. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/tests/.gitkeep +0 -0
  56. {scholarimpact-0.0.1.dev1 → scholarimpact-0.0.2.dev2}/tests/test_basic.py +0 -0
@@ -207,7 +207,7 @@ example-dashboard
207
207
  my-research-dashboard
208
208
  .DS_Store
209
209
  .claude
210
- data
210
+ data/8/json
211
211
 
212
212
  # setuptools-scm generated version file
213
213
  src/scholarimpact/_version.py
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scholarimpact
3
- Version: 0.0.1.dev1
3
+ Version: 0.0.2.dev2
4
4
  Summary: A bibliometric tool to analyse, visualise, and share your research impact, output and scholarly influence using Google Scholar and OpenAlex data
5
5
  Author-email: Abhishek Tiwari <scholarimpact@abhishek-tiwari.com>
6
6
  License: MIT
@@ -53,9 +53,9 @@ A bibliometric tool to analyse, visualise, and share your research impact, outpu
53
53
 
54
54
  For each article under your Google Scholar Profile, **_ScholarImpact_**: (1) total number of citations, (2) number of unique authors who have cited the article, (3) number of countries from which citations originate, (4) number of institutions from which citations originate, (5) geographic distribution of citations, (6) citation trends over time, (7) research domain analysis, (8) interdisciplinary impact Metrics including Patents and Wikipedia mentions.
55
55
 
56
- ![Example Dashboard](example-dashboard.png)
56
+ ![Example Dashboard](https://static.abhishek-tiwari.com/scholarimpact/example-dashboard.png)
57
57
 
58
- ![Research Domains Analysis](research-domains.png)
58
+ ![Research Domains Analysis](https://static.abhishek-tiwari.com/scholarimpact/research-domains.png)
59
59
 
60
60
  ## Workflow Overview
61
61
  This workflow extracts author data from your Google Scholar profile, then crawls citations for each article under your Google Scholar profile. Next workflow enriches them with information using Google Scholar profiles of citing authors and OpenAlex APIs. Finally, output data is used to present your impact of your research with geographic and institutional insights.
@@ -3,9 +3,9 @@ A bibliometric tool to analyse, visualise, and share your research impact, outpu
3
3
 
4
4
  For each article under your Google Scholar Profile, **_ScholarImpact_**: (1) total number of citations, (2) number of unique authors who have cited the article, (3) number of countries from which citations originate, (4) number of institutions from which citations originate, (5) geographic distribution of citations, (6) citation trends over time, (7) research domain analysis, (8) interdisciplinary impact Metrics including Patents and Wikipedia mentions.
5
5
 
6
- ![Example Dashboard](example-dashboard.png)
6
+ ![Example Dashboard](https://static.abhishek-tiwari.com/scholarimpact/example-dashboard.png)
7
7
 
8
- ![Research Domains Analysis](research-domains.png)
8
+ ![Research Domains Analysis](https://static.abhishek-tiwari.com/scholarimpact/research-domains.png)
9
9
 
10
10
  ## Workflow Overview
11
11
  This workflow extracts author data from your Google Scholar profile, then crawls citations for each article under your Google Scholar profile. Next workflow enriches them with information using Google Scholar profiles of citing authors and OpenAlex APIs. Finally, output data is used to present your impact of your research with geographic and institutional insights.
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.0.1.dev1'
21
- __version_tuple__ = version_tuple = (0, 0, 1, 'dev1')
20
+ __version__ = version = '0.0.2.dev2'
21
+ __version_tuple__ = version_tuple = (0, 0, 2, 'dev2')
@@ -96,6 +96,18 @@ class Dashboard:
96
96
  port: Port to run dashboard on (optional, uses instance port)
97
97
  debug: Enable debug mode
98
98
  """
99
+ # Check if we're already running in Streamlit context
100
+ try:
101
+ import streamlit as st
102
+ # If we can access Streamlit's runtime, we're already in a Streamlit app
103
+ if hasattr(st, 'runtime') and st.runtime.exists():
104
+ # Just render directly, no subprocess needed
105
+ self.render_app()
106
+ return
107
+ except:
108
+ # Not in Streamlit context or error checking, proceed with subprocess
109
+ pass
110
+
99
111
  if port is None:
100
112
  port = self.port
101
113
 
@@ -0,0 +1,5 @@
1
+ """Data module for ScholarImpact."""
2
+
3
+ from .loader import load_data
4
+
5
+ __all__ = ['load_data']
@@ -0,0 +1,131 @@
1
+ """
2
+ Data loading utilities for ScholarImpact.
3
+ """
4
+
5
+ import json
6
+ import logging
7
+ import os
8
+ from pathlib import Path
9
+ from typing import Any, Dict, Optional
10
+
11
+ import pandas as pd
12
+
13
+ logger = logging.getLogger(__name__)
14
+
15
+ def load_data(data_dir: str = 'data') -> Dict[str, Any]:
16
+ """
17
+ Load citation data from the data directory.
18
+
19
+ Args:
20
+ data_dir: Directory containing the data files
21
+
22
+ Returns:
23
+ Dictionary containing loaded data
24
+ """
25
+ data = {}
26
+ data_path = Path(data_dir)
27
+
28
+ if not data_path.exists():
29
+ logger.warning(f"Data directory {data_dir} does not exist")
30
+ return data
31
+
32
+ # Load author.json
33
+ author_file = data_path / 'author.json'
34
+ if author_file.exists():
35
+ try:
36
+ with open(author_file, 'r', encoding='utf-8') as f:
37
+ data['author'] = json.load(f)
38
+
39
+ # Extract articles if present
40
+ if 'articles' in data['author']:
41
+ data['articles'] = pd.DataFrame(data['author']['articles'])
42
+
43
+ logger.info(f"Loaded author data from {author_file}")
44
+ except Exception as e:
45
+ logger.error(f"Error loading author data: {e}")
46
+
47
+ # Load citation files
48
+ citation_files = list(data_path.glob('cites-*.json'))
49
+ if citation_files:
50
+ data['citation_files'] = {}
51
+ for citation_file in citation_files:
52
+ try:
53
+ with open(citation_file, 'r', encoding='utf-8') as f:
54
+ citations = json.load(f)
55
+ # Extract cites_id from filename
56
+ cites_id = citation_file.stem.replace('cites-', '')
57
+ data['citation_files'][cites_id] = citations
58
+
59
+ except Exception as e:
60
+ logger.warning(f"Error loading {citation_file}: {e}")
61
+
62
+ logger.info(f"Loaded {len(data['citation_files'])} citation files")
63
+
64
+ # Process and enhance articles data if available
65
+ if 'articles' in data and not data['articles'].empty:
66
+ data['articles'] = enhance_articles_data(data['articles'], data.get('citation_files', {}))
67
+
68
+ return data
69
+
70
+ def enhance_articles_data(articles_df: pd.DataFrame, citation_files: Dict[str, Any]) -> pd.DataFrame:
71
+ """
72
+ Enhance articles data with citation analysis.
73
+
74
+ Args:
75
+ articles_df: DataFrame containing article data
76
+ citation_files: Dictionary of citation files
77
+
78
+ Returns:
79
+ Enhanced DataFrame
80
+ """
81
+ # Initialize new columns
82
+ articles_df['crawler_data_available'] = False
83
+ articles_df['unique_citing_authors'] = 0
84
+ articles_df['unique_countries'] = 0
85
+ articles_df['unique_institutions'] = 0
86
+
87
+ for idx, row in articles_df.iterrows():
88
+ cites_id = row.get('cites_id', '')
89
+ if not cites_id:
90
+ continue
91
+
92
+ # Handle multiple IDs
93
+ if ',' in str(cites_id):
94
+ file_cites_id = str(cites_id).replace(',', '_')
95
+ else:
96
+ file_cites_id = str(cites_id)
97
+
98
+ # Check if we have citation data
99
+ if file_cites_id in citation_files:
100
+ articles_df.at[idx, 'crawler_data_available'] = True
101
+ citations = citation_files[file_cites_id]
102
+
103
+ # Count unique citing authors
104
+ citing_authors = set()
105
+ countries = set()
106
+ institutions = set()
107
+
108
+ for citation in citations:
109
+ # Extract authors
110
+ if 'citing_authors' in citation:
111
+ authors = citation['citing_authors'].split(',')
112
+ for author in authors:
113
+ author = author.strip()
114
+ if author and author != 'Unknown':
115
+ citing_authors.add(author)
116
+
117
+ # Extract countries and institutions from author details
118
+ for author_detail in citation.get('citing_authors_details', []):
119
+ country = author_detail.get('country', '')
120
+ if country and country not in ['Unknown', '']:
121
+ countries.add(country)
122
+
123
+ institution = author_detail.get('institution_display_name', '')
124
+ if institution and institution not in ['Unknown', '']:
125
+ institutions.add(institution)
126
+
127
+ articles_df.at[idx, 'unique_citing_authors'] = len(citing_authors)
128
+ articles_df.at[idx, 'unique_countries'] = len(countries)
129
+ articles_df.at[idx, 'unique_institutions'] = len(institutions)
130
+
131
+ return articles_df
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scholarimpact
3
- Version: 0.0.1.dev1
3
+ Version: 0.0.2.dev2
4
4
  Summary: A bibliometric tool to analyse, visualise, and share your research impact, output and scholarly influence using Google Scholar and OpenAlex data
5
5
  Author-email: Abhishek Tiwari <scholarimpact@abhishek-tiwari.com>
6
6
  License: MIT
@@ -53,9 +53,9 @@ A bibliometric tool to analyse, visualise, and share your research impact, outpu
53
53
 
54
54
  For each article under your Google Scholar Profile, **_ScholarImpact_**: (1) total number of citations, (2) number of unique authors who have cited the article, (3) number of countries from which citations originate, (4) number of institutions from which citations originate, (5) geographic distribution of citations, (6) citation trends over time, (7) research domain analysis, (8) interdisciplinary impact Metrics including Patents and Wikipedia mentions.
55
55
 
56
- ![Example Dashboard](example-dashboard.png)
56
+ ![Example Dashboard](https://static.abhishek-tiwari.com/scholarimpact/example-dashboard.png)
57
57
 
58
- ![Research Domains Analysis](research-domains.png)
58
+ ![Research Domains Analysis](https://static.abhishek-tiwari.com/scholarimpact/research-domains.png)
59
59
 
60
60
  ## Workflow Overview
61
61
  This workflow extracts author data from your Google Scholar profile, then crawls citations for each article under your Google Scholar profile. Next workflow enriches them with information using Google Scholar profiles of citing authors and OpenAlex APIs. Finally, output data is used to present your impact of your research with geographic and institutional insights.
@@ -3,11 +3,9 @@ CITATION.cff
3
3
  LICENSE
4
4
  Makefile
5
5
  README.md
6
- example-dashboard.png
7
6
  pyproject.toml
8
7
  requirements-dev.txt
9
8
  requirements.txt
10
- research-domains.png
11
9
  .github/workflows/cleanup-prereleases.yml
12
10
  .github/workflows/release.yml
13
11
  .github/workflows/test.yml
@@ -48,5 +46,7 @@ src/scholarimpact/dashboard/components/base.py
48
46
  src/scholarimpact/dashboard/components/config.py
49
47
  src/scholarimpact/dashboard/components/layout.py
50
48
  src/scholarimpact/dashboard/components/streamlit_app.py
49
+ src/scholarimpact/data/__init__.py
50
+ src/scholarimpact/data/loader.py
51
51
  tests/.gitkeep
52
52
  tests/test_basic.py