impact-factor 1.1.3__py3-none-any.whl
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.
- impact_factor/__init__.py +12 -0
- impact_factor/bin/__init__.py +0 -0
- impact_factor/bin/_build.py +80 -0
- impact_factor/bin/_filter.py +41 -0
- impact_factor/bin/_search.py +39 -0
- impact_factor/bin/cli.py +40 -0
- impact_factor/core/__init__.py +3 -0
- impact_factor/core/database.py +20 -0
- impact_factor/core/factor.py +66 -0
- impact_factor/core/nlmcatalog.py +83 -0
- impact_factor/data/2022_JCR_IF.xlsx +0 -0
- impact_factor/data/CopyofImpactFactor2024.xlsx +0 -0
- impact_factor/data/impact_factor.sqlite3 +0 -0
- impact_factor/util/__init__.py +38 -0
- impact_factor/util/excel_parser.py +44 -0
- impact_factor/version.json +8 -0
- impact_factor-1.1.3.dist-info/METADATA +112 -0
- impact_factor-1.1.3.dist-info/RECORD +21 -0
- impact_factor-1.1.3.dist-info/WHEEL +5 -0
- impact_factor-1.1.3.dist-info/entry_points.txt +3 -0
- impact_factor-1.1.3.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
BASE_DIR = Path(__file__).resolve().parent
|
|
6
|
+
|
|
7
|
+
DEFAULT_DB = BASE_DIR.joinpath('data', 'impact_factor.sqlite3')
|
|
8
|
+
DEFAULT_EXCEL = BASE_DIR.joinpath('data', '2022_JCR_IF.xlsx')
|
|
9
|
+
|
|
10
|
+
version_info = json.load(BASE_DIR.joinpath('version.json').open())
|
|
11
|
+
|
|
12
|
+
__version__ = version_info['version']
|
|
File without changes
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
import click
|
|
4
|
+
|
|
5
|
+
from impact_factor import util, DEFAULT_EXCEL
|
|
6
|
+
from impact_factor.core import NlmCatalog
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
EPILOG = click.style('''
|
|
10
|
+
\n\b
|
|
11
|
+
examples:
|
|
12
|
+
impact_factor build -i tests/IF.xlsx
|
|
13
|
+
\b
|
|
14
|
+
# with a ncbi api_key
|
|
15
|
+
impact_factor build -k YOUR_NCBI_API_KEY
|
|
16
|
+
\b
|
|
17
|
+
# use a new dbfile [*recommend*]
|
|
18
|
+
impact_factor -d test.db build -i tests/IF.xlsx
|
|
19
|
+
\b
|
|
20
|
+
# without nlm_catalog
|
|
21
|
+
impact_factor -d test.db build -i tests/IF.xlsx -n
|
|
22
|
+
''', fg='yellow', italic=True)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@click.command(
|
|
26
|
+
name='build',
|
|
27
|
+
help=click.style('build/update the database', italic=True, fg='green'),
|
|
28
|
+
no_args_is_help=True,
|
|
29
|
+
epilog=EPILOG,
|
|
30
|
+
)
|
|
31
|
+
@click.option('-i', '--excel', help='the excel file with IF')
|
|
32
|
+
@click.option('-u', '--update', help='update all records', is_flag=True)
|
|
33
|
+
@click.option('-f', '--force', help='force update when database already exists', is_flag=True)
|
|
34
|
+
@click.option('-k', '--ncbi_api_key', help='specify a NCBI_API_KEY', envvar='NCBI_API_KEY', show_envvar=True)
|
|
35
|
+
@click.option('-n', '--no-nlm', help='do not use nlm catalog', is_flag=True)
|
|
36
|
+
@click.pass_context
|
|
37
|
+
def main(ctx, **kwargs):
|
|
38
|
+
|
|
39
|
+
with ctx.obj['manager'] as manager:
|
|
40
|
+
if (key := kwargs['ncbi_api_key']):
|
|
41
|
+
NlmCatalog._api_key = key
|
|
42
|
+
|
|
43
|
+
if manager.query().count() > 0 and not kwargs['force']:
|
|
44
|
+
dbfile = ctx.obj['dbfile']
|
|
45
|
+
overwrite = click.confirm(f'db already exists, overwrite? [{dbfile}]')
|
|
46
|
+
if not overwrite:
|
|
47
|
+
exit()
|
|
48
|
+
|
|
49
|
+
for n, context in enumerate(util.parse_excel(kwargs['excel'])):
|
|
50
|
+
click.secho(f'>>> dealing with: [{n}]')
|
|
51
|
+
issn = context['issn']
|
|
52
|
+
eissn = context['eissn']
|
|
53
|
+
journal = context['journal']
|
|
54
|
+
|
|
55
|
+
record = manager.query('journal', journal).first()
|
|
56
|
+
|
|
57
|
+
# update when record is not in database, or force update
|
|
58
|
+
if record is None or kwargs['update']:
|
|
59
|
+
|
|
60
|
+
if not kwargs['no_nlm']:
|
|
61
|
+
res = None
|
|
62
|
+
if eissn:
|
|
63
|
+
res = NlmCatalog.search(f'{eissn}[ISSN]')
|
|
64
|
+
if not res and issn:
|
|
65
|
+
res = NlmCatalog.search(f'{issn}[ISSN]')
|
|
66
|
+
if not res:
|
|
67
|
+
res = NlmCatalog.search(journal)
|
|
68
|
+
|
|
69
|
+
if res:
|
|
70
|
+
context.update(res)
|
|
71
|
+
else:
|
|
72
|
+
manager.logger.warning(f'no result for: {context}')
|
|
73
|
+
|
|
74
|
+
try:
|
|
75
|
+
float(context['factor'])
|
|
76
|
+
except ValueError:
|
|
77
|
+
continue
|
|
78
|
+
|
|
79
|
+
manager.insert(context, key='journal')
|
|
80
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
3
|
+
import click
|
|
4
|
+
|
|
5
|
+
from impact_factor import util
|
|
6
|
+
from impact_factor.core import Factor
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
EPILOG = click.style('''
|
|
10
|
+
\n\b
|
|
11
|
+
examples:
|
|
12
|
+
impact_factor filter -m 50
|
|
13
|
+
impact_factor filter -m 50 -M 100
|
|
14
|
+
impact_factor filter -m 50 -M 100 -C
|
|
15
|
+
impact_factor filter -m 50 -M 100 -P
|
|
16
|
+
''', fg='yellow', italic=True)
|
|
17
|
+
|
|
18
|
+
@click.command(
|
|
19
|
+
name='filter',
|
|
20
|
+
help=click.style('filter according to factor', italic=True, fg='cyan'),
|
|
21
|
+
no_args_is_help=True,
|
|
22
|
+
epilog=EPILOG,
|
|
23
|
+
)
|
|
24
|
+
@click.option('-m', '--min-value', help='the min factor', type=float)
|
|
25
|
+
@click.option('-M', '--max-value', help='the max factor', type=float)
|
|
26
|
+
@click.option('-C', '--color', help='colorful output', is_flag=True)
|
|
27
|
+
@click.option('-P', '--pubmed-filter', help='output pubmed filter format', is_flag=True)
|
|
28
|
+
@click.option('-L', '--limit', help='the limit of results', type=int, default=100, show_default=True)
|
|
29
|
+
@click.pass_context
|
|
30
|
+
def main(ctx, **kwargs):
|
|
31
|
+
|
|
32
|
+
fa = Factor(ctx.obj['dbfile'])
|
|
33
|
+
|
|
34
|
+
res = fa.filter(**kwargs)
|
|
35
|
+
|
|
36
|
+
if kwargs['pubmed_filter']:
|
|
37
|
+
print(res)
|
|
38
|
+
else:
|
|
39
|
+
if kwargs['color']:
|
|
40
|
+
res = util.highlight_json(json.dumps(res, indent=2))
|
|
41
|
+
print(res)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
3
|
+
import click
|
|
4
|
+
|
|
5
|
+
from impact_factor import util
|
|
6
|
+
from impact_factor.core import Factor
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
EPILOG = click.style('''
|
|
10
|
+
\n\b
|
|
11
|
+
examples:
|
|
12
|
+
impact_factor search nature # search journal
|
|
13
|
+
impact_factor search 'nature c%' # like search journal
|
|
14
|
+
impact_factor search 0028-0836 # search ISSN
|
|
15
|
+
impact_factor search 1476-4687 # search eISSN
|
|
16
|
+
impact_factor search 0410462 # search nlm_id
|
|
17
|
+
impact_factor search nature --color # colorful output
|
|
18
|
+
''', fg='yellow', italic=True)
|
|
19
|
+
|
|
20
|
+
@click.command(
|
|
21
|
+
name='search',
|
|
22
|
+
help=click.style('search record from database', italic=True, fg='magenta'),
|
|
23
|
+
no_args_is_help=True,
|
|
24
|
+
epilog=EPILOG,
|
|
25
|
+
)
|
|
26
|
+
@click.argument('value')
|
|
27
|
+
@click.option('-f', '--field', help='specify a field to search')
|
|
28
|
+
@click.option('-C', '--color', help='colorful output', is_flag=True)
|
|
29
|
+
@click.pass_context
|
|
30
|
+
def main(ctx, **kwargs):
|
|
31
|
+
|
|
32
|
+
fa = Factor(ctx.obj['dbfile'])
|
|
33
|
+
|
|
34
|
+
res = fa.search(kwargs['value'], key=kwargs['field'])
|
|
35
|
+
|
|
36
|
+
if kwargs['color']:
|
|
37
|
+
res = util.highlight_json(json.dumps(res, indent=2))
|
|
38
|
+
|
|
39
|
+
print(res)
|
impact_factor/bin/cli.py
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import click
|
|
3
|
+
|
|
4
|
+
from impact_factor import version_info, DEFAULT_DB
|
|
5
|
+
from impact_factor.core import FactorManager
|
|
6
|
+
from impact_factor.bin._build import main as build_cli
|
|
7
|
+
from impact_factor.bin._search import main as search_cli
|
|
8
|
+
from impact_factor.bin._filter import main as filter_cli
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
EPILOG = 'contact: {author} <{author_email}>'.format(**version_info)
|
|
12
|
+
|
|
13
|
+
CONTEXT_SETTINGS = dict(help_option_names=['-?', '-h', '--help'])
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@click.group(
|
|
17
|
+
name=version_info['prog'],
|
|
18
|
+
help=click.style(version_info['desc'], italic=True, fg='cyan', bold=True),
|
|
19
|
+
context_settings=CONTEXT_SETTINGS,
|
|
20
|
+
no_args_is_help=True,
|
|
21
|
+
epilog=click.style(EPILOG, fg='bright_white', italic=True),
|
|
22
|
+
)
|
|
23
|
+
@click.option('-d', '--dbfile', help='the database file path', default=DEFAULT_DB, show_default=True)
|
|
24
|
+
@click.version_option(version=version_info['version'], prog_name=version_info['prog'])
|
|
25
|
+
@click.pass_context
|
|
26
|
+
def cli(ctx, **kwargs):
|
|
27
|
+
ctx.ensure_object(dict)
|
|
28
|
+
ctx.obj['dbfile'] = kwargs['dbfile']
|
|
29
|
+
ctx.obj['manager'] = FactorManager(kwargs['dbfile'])
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def main():
|
|
33
|
+
cli.add_command(build_cli)
|
|
34
|
+
cli.add_command(search_cli)
|
|
35
|
+
cli.add_command(filter_cli)
|
|
36
|
+
cli()
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
if __name__ == '__main__':
|
|
40
|
+
main()
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import functools
|
|
2
|
+
|
|
3
|
+
from sql_manager import DynamicModel, Manager
|
|
4
|
+
from sqlalchemy import Column, Float, String
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
columns = {
|
|
8
|
+
'nlm_id': Column(String, comment='the unique ID of NLM', default='.'),
|
|
9
|
+
'factor': Column(Float(3), comment='the IF of journal'),
|
|
10
|
+
'jcr': Column(String, comment='the partition of JCR', default='.'),
|
|
11
|
+
'journal': Column(String, comment='the title of journal', primary_key=True),
|
|
12
|
+
'journal_abbr': Column(String, comment='the abbreviation of journal', default='.'),
|
|
13
|
+
'issn': Column(String, comment='the ISSN of journal', default='.'),
|
|
14
|
+
'eissn': Column(String, comment='the eISSN of journal', default='.'),
|
|
15
|
+
'zky': Column(String, comment='the partition of ZKY', default='.'),
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
FactorData = DynamicModel('Factor', columns, 'factor')
|
|
19
|
+
|
|
20
|
+
FactorManager = functools.partial(Manager, FactorData)
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
from sqlalchemy import func
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
from impact_factor import DEFAULT_DB, util
|
|
5
|
+
from .database import FactorData, FactorManager
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Factor(object):
|
|
9
|
+
"""Impact Factor ToolKits
|
|
10
|
+
|
|
11
|
+
examples:
|
|
12
|
+
>>> from impact_factor.core import Factor
|
|
13
|
+
>>> fa = Factor()
|
|
14
|
+
>>> fa.search('nature')
|
|
15
|
+
>>> fa.search('nature c%')
|
|
16
|
+
>>> fa.search('1579-3680', key='eissn')
|
|
17
|
+
>>> fa.filter(min_value=5, max_value=6)
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
def __init__(self, dbfile=DEFAULT_DB):
|
|
21
|
+
self.dbfile = dbfile
|
|
22
|
+
self.manager = FactorManager(dbfile)
|
|
23
|
+
self.query = self.manager.session.query(FactorData)
|
|
24
|
+
|
|
25
|
+
def search(self, value, key=None):
|
|
26
|
+
"""
|
|
27
|
+
search something
|
|
28
|
+
"""
|
|
29
|
+
default_keys = ['issn', 'eissn', 'nlm_id', 'journal', 'journal_abbr']
|
|
30
|
+
keys = [key] if key else default_keys
|
|
31
|
+
|
|
32
|
+
for field in keys:
|
|
33
|
+
if '%' in value:
|
|
34
|
+
result = self.query.filter(
|
|
35
|
+
FactorData.__dict__[field].like(value))
|
|
36
|
+
else:
|
|
37
|
+
result = self.query.filter(
|
|
38
|
+
func.lower(FactorData.__dict__[field]) == func.lower(value))
|
|
39
|
+
|
|
40
|
+
if result.count():
|
|
41
|
+
data = [util.record_to_dict(record) for record in result]
|
|
42
|
+
return data
|
|
43
|
+
|
|
44
|
+
return []
|
|
45
|
+
|
|
46
|
+
def filter(self, min_value=None, max_value=None, pubmed_filter=False, limit=None, **kwargs):
|
|
47
|
+
"""
|
|
48
|
+
filter factor, or generate pubmed filter
|
|
49
|
+
"""
|
|
50
|
+
query = self.query
|
|
51
|
+
|
|
52
|
+
if min_value is not None:
|
|
53
|
+
query = query.filter(FactorData.factor >= min_value)
|
|
54
|
+
|
|
55
|
+
if max_value is not None:
|
|
56
|
+
query = query.filter(FactorData.factor <= max_value)
|
|
57
|
+
|
|
58
|
+
if pubmed_filter:
|
|
59
|
+
query = query.filter(FactorData.nlm_id != '.', FactorData.factor != 0)
|
|
60
|
+
return util.pubmed_filter_builder(query)
|
|
61
|
+
|
|
62
|
+
if limit and (count := query.count()) > limit:
|
|
63
|
+
self.manager.logger.warning(f'{count} records found, but limit is {limit}')
|
|
64
|
+
query = query.limit(limit)
|
|
65
|
+
|
|
66
|
+
return [util.record_to_dict(record) for record in query]
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import time
|
|
3
|
+
|
|
4
|
+
from webrequests import WebRequest as WR
|
|
5
|
+
|
|
6
|
+
try:
|
|
7
|
+
import lxml.etree as ET
|
|
8
|
+
except ImportError:
|
|
9
|
+
import xml.etree.cElementTree as ET
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class NlmCatalog(object):
|
|
13
|
+
|
|
14
|
+
base_url = 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/'
|
|
15
|
+
|
|
16
|
+
_common_params = {'db': 'nlmcatalog'}
|
|
17
|
+
|
|
18
|
+
_api_key = os.getenv('NCBI_API_KEY')
|
|
19
|
+
if _api_key:
|
|
20
|
+
print(f'use api_key: {_api_key}')
|
|
21
|
+
_common_params['api_key'] = _api_key
|
|
22
|
+
|
|
23
|
+
@classmethod
|
|
24
|
+
def search(cls, term):
|
|
25
|
+
"""
|
|
26
|
+
search term with efetch api,
|
|
27
|
+
and return nlm_id and journal_abbr
|
|
28
|
+
"""
|
|
29
|
+
url = f'{cls.base_url}esearch.fcgi'
|
|
30
|
+
payload = {
|
|
31
|
+
**cls._common_params,
|
|
32
|
+
'term': term,
|
|
33
|
+
'format': 'json',
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
while True:
|
|
37
|
+
try:
|
|
38
|
+
result = WR.get_response(url, params=payload).json()['esearchresult']
|
|
39
|
+
|
|
40
|
+
if (count := result['count']) != '1':
|
|
41
|
+
print(f'{term} has {count} result!')
|
|
42
|
+
return False
|
|
43
|
+
|
|
44
|
+
nlm_id = result['idlist'][0]
|
|
45
|
+
xml = cls.fetch(nlm_id)
|
|
46
|
+
tree = cls.parse(xml)
|
|
47
|
+
|
|
48
|
+
context = {}
|
|
49
|
+
context['nlm_id'] = nlm_id
|
|
50
|
+
context['journal_abbr'] = tree.findtext('NLMCatalogRecord/MedlineTA')
|
|
51
|
+
|
|
52
|
+
return context
|
|
53
|
+
except Exception as e:
|
|
54
|
+
print(e)
|
|
55
|
+
time.sleep(5)
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def fetch(cls, id):
|
|
59
|
+
"""
|
|
60
|
+
fetch xml string from nlm_id
|
|
61
|
+
"""
|
|
62
|
+
url = f'{cls.base_url}efetch.fcgi'
|
|
63
|
+
payload = {
|
|
64
|
+
**cls._common_params,
|
|
65
|
+
'id': id,
|
|
66
|
+
'format': 'xml',
|
|
67
|
+
}
|
|
68
|
+
resp = WR.get_response(url, params=payload)
|
|
69
|
+
|
|
70
|
+
return resp.text
|
|
71
|
+
|
|
72
|
+
@classmethod
|
|
73
|
+
def parse(cls, xml):
|
|
74
|
+
"""
|
|
75
|
+
return an etree object from xml
|
|
76
|
+
"""
|
|
77
|
+
tree = ET.fromstring(xml)
|
|
78
|
+
return tree
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
if __name__ == '__main__':
|
|
82
|
+
NlmCatalog.search('0334-9152[ISSN]')
|
|
83
|
+
NlmCatalog.fetch('101474857')
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from sqlalchemy.orm.state import InstanceState
|
|
2
|
+
from pygments import highlight, lexers, formatters
|
|
3
|
+
|
|
4
|
+
from .excel_parser import parse_excel
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def highlight_json(jsons):
|
|
8
|
+
"""
|
|
9
|
+
highlight json string with pygments
|
|
10
|
+
"""
|
|
11
|
+
return highlight(
|
|
12
|
+
jsons,
|
|
13
|
+
lexers.JsonLexer(),
|
|
14
|
+
formatters.TerminalFormatter()
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def record_to_dict(records):
|
|
19
|
+
"""
|
|
20
|
+
convert Query result to dict
|
|
21
|
+
"""
|
|
22
|
+
return {
|
|
23
|
+
k: v
|
|
24
|
+
for k, v in records.__dict__.items()
|
|
25
|
+
if not isinstance(v, InstanceState)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def pubmed_filter_builder(query):
|
|
30
|
+
res = '|'.join(
|
|
31
|
+
record.issn
|
|
32
|
+
for record in query
|
|
33
|
+
)
|
|
34
|
+
if (length := len(res)) > 4000:
|
|
35
|
+
raise Exception(
|
|
36
|
+
f'pubmed filter limit 4000 characters, yours is {length}, please change your factor range'
|
|
37
|
+
)
|
|
38
|
+
return res
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import re
|
|
2
|
+
import openpyxl
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def get_jcr(category):
|
|
6
|
+
"""
|
|
7
|
+
get catagory of JCR
|
|
8
|
+
"""
|
|
9
|
+
res = re.findall(r'[|(](Q\d)[)|]', category)
|
|
10
|
+
return res[0] if res else ''
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def parse_excel(infile):
|
|
14
|
+
"""
|
|
15
|
+
parse excel file of JCR IF
|
|
16
|
+
|
|
17
|
+
fields: JIF, ISSN, EISSN, JCR, ZKY, JOURNAL, JOURNAL_ABBR
|
|
18
|
+
"""
|
|
19
|
+
wb = openpyxl.load_workbook(infile)
|
|
20
|
+
ws = wb.active
|
|
21
|
+
|
|
22
|
+
for values in ws.values:
|
|
23
|
+
if values[0] is None:
|
|
24
|
+
continue
|
|
25
|
+
if values[0] in ('JOURNAL', 'Journal Name', 'Name'):
|
|
26
|
+
title = [v.upper() for v in values]
|
|
27
|
+
continue
|
|
28
|
+
context = dict(zip(title, values))
|
|
29
|
+
data = {}
|
|
30
|
+
data['factor'] = context['JIF']
|
|
31
|
+
data['issn'] = context['ISSN']
|
|
32
|
+
data['eissn'] = context['EISSN']
|
|
33
|
+
data['journal'] = context['JOURNAL']
|
|
34
|
+
data['jcr'] = context.get('JCR')
|
|
35
|
+
data['zky'] = context.get('ZKY')
|
|
36
|
+
data['journal_abbr'] = context.get('JOURNAL_ABBR')
|
|
37
|
+
|
|
38
|
+
yield data
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
if __name__ == '__main__':
|
|
42
|
+
# for context in parse_excel('tests/2022_JCR_IF.xlsx'):
|
|
43
|
+
for context in parse_excel('tests/CopyofImpactFactor2024.xlsx'):
|
|
44
|
+
print(context)
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: impact_factor
|
|
3
|
+
Version: 1.1.3
|
|
4
|
+
Summary: Impact Factor Toolkits
|
|
5
|
+
Home-page: https://github.com/suqingdong/impact_factor
|
|
6
|
+
Author: suqingdong
|
|
7
|
+
Author-email: suqingdong1114@gmail.com
|
|
8
|
+
License: MIT License
|
|
9
|
+
Project-URL: Documentation, https://impact_factor.readthedocs.io
|
|
10
|
+
Project-URL: Tracker, https://github.com/suqingdong/impact_factor/issues
|
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
Requires-Dist: lxml
|
|
23
|
+
Requires-Dist: click
|
|
24
|
+
Requires-Dist: openpyxl
|
|
25
|
+
Requires-Dist: pygments
|
|
26
|
+
Requires-Dist: webrequests
|
|
27
|
+
Requires-Dist: sql_manager
|
|
28
|
+
|
|
29
|
+
[](https://doi.org/10.5281/zenodo.7539859)
|
|
30
|
+
|
|
31
|
+
[](https://pepy.tech/project/impact-factor)
|
|
32
|
+

|
|
33
|
+

|
|
34
|
+

|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
# ***最新SCI期刊影响因子查询系统***
|
|
38
|
+
- *已更新 **2025年数据***
|
|
39
|
+
- *包含JCR分区表数据*
|
|
40
|
+
- *包含中科院分区表数据*
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
```bash
|
|
44
|
+
python3 -m pip install -U impact_factor
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Use in CMD
|
|
48
|
+
```bash
|
|
49
|
+
impact_factor -h
|
|
50
|
+
```
|
|
51
|
+

|
|
52
|
+
|
|
53
|
+
### `build`
|
|
54
|
+
> build/update the database
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# optional, only required when you need build or update the database
|
|
58
|
+
impact_factor build -i tests/IF.xlsx
|
|
59
|
+
|
|
60
|
+
# with a ncbi api_key
|
|
61
|
+
impact_factor build -k YOUR_NCBI_API_KEY
|
|
62
|
+
|
|
63
|
+
# use a new dbfile [*recommend*]
|
|
64
|
+
impact_factor -d test.db build -i tests/IF.xlsx
|
|
65
|
+
|
|
66
|
+
# without nlm_catalog
|
|
67
|
+
impact_factor -d test.db build -i tests/IF.xlsx -n
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### `search`
|
|
71
|
+
> search with `journal`, `journal_abbr`, `issn`, `eissn` or `nlm_id`
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
impact_factor search nature # search journal
|
|
75
|
+
impact_factor search 'nature c%' # like search journal
|
|
76
|
+
impact_factor search 0028-0836 # search ISSN
|
|
77
|
+
impact_factor search 1476-4687 # search eISSN
|
|
78
|
+
impact_factor search 0410462 # search nlm_id
|
|
79
|
+
impact_factor search nature --color # colorful output
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+

|
|
83
|
+
|
|
84
|
+
### `filter`
|
|
85
|
+
> filter `factor` with `min_value` and `max_value`
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
impact_factor filter -m 100 -M 200 --color
|
|
89
|
+
|
|
90
|
+
# output with pubmed filter format
|
|
91
|
+
impact_factor filter -m 100 -M 200 --pubmed-filter
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+

|
|
95
|
+
|
|
96
|
+
## Use in Python
|
|
97
|
+
```python
|
|
98
|
+
from impact_factor.core import Factor
|
|
99
|
+
|
|
100
|
+
fa = Factor()
|
|
101
|
+
|
|
102
|
+
print(fa.dbfile)
|
|
103
|
+
|
|
104
|
+
fa.search('nature')
|
|
105
|
+
fa.search('nature c%')
|
|
106
|
+
|
|
107
|
+
fa.filter(min_value=100, max_value=200)
|
|
108
|
+
fa.filter(min_value=100, max_value=200, pubmed_filter=True)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Documents
|
|
112
|
+
https://impact-factor.readthedocs.io
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
impact_factor/__init__.py,sha256=GoLmOoeOBxxraNS_coru5YOxnOdoWd7ZaEUIwttRfic,328
|
|
2
|
+
impact_factor/version.json,sha256=oaNNCLe4twvsW4IYUQMXM4geY_Cdlc7aM9I9dy5p9xc,236
|
|
3
|
+
impact_factor/bin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
impact_factor/bin/_build.py,sha256=--HPgTvMD2oGbEfOF7U2-boJjMZtyT3BvSZVqIxQCJc,2691
|
|
5
|
+
impact_factor/bin/_filter.py,sha256=JOnQSCTgKWM2IJK-sfF3ywWA5rq2rPkh-md6C1z5-Co,1206
|
|
6
|
+
impact_factor/bin/_search.py,sha256=5YdUpt5-Y37IibfYHi16ZZXLWvVZ2MfZbOkWgk7sKzE,1112
|
|
7
|
+
impact_factor/bin/cli.py,sha256=Fepdk5aPUcZ23OeKCTG9WCmzZWrEtfk_5881NM0Dzjg,1242
|
|
8
|
+
impact_factor/core/__init__.py,sha256=tEhsbpbHE6KRnwXg5OMJNV-2dl1kQpRw0c3BPb8yrJY,113
|
|
9
|
+
impact_factor/core/database.py,sha256=HARdbwyyzoxZXuq47pFc7xQadJiEwVxQFsRQccv_naY,852
|
|
10
|
+
impact_factor/core/factor.py,sha256=GoFqPbmCuFVbo4s47zMAZhzSyGc9GXTD3ujVFacrNoo,2181
|
|
11
|
+
impact_factor/core/nlmcatalog.py,sha256=OJpI-eh9D3zfqljqRSi611ka46dAAte6P-qt9lkYgrM,2144
|
|
12
|
+
impact_factor/data/2022_JCR_IF.xlsx,sha256=NJoAKC7RL3W_oBvv72j9mU5bZydEEAPDO8sza-R6JKE,929300
|
|
13
|
+
impact_factor/data/CopyofImpactFactor2024.xlsx,sha256=2POoCl1Nf7WCG242KUjvU06J43RIoCpT4BEucCxIQBw,1756410
|
|
14
|
+
impact_factor/data/impact_factor.sqlite3,sha256=gZsaOr-BrnbJu95IEDkeDgwfnX3Vk6_w3Az_bNlFuyI,2813952
|
|
15
|
+
impact_factor/util/__init__.py,sha256=oeF6lUgRWjm_yAAUqCAmy6SW22ojyjX_-ck_CiPI_xU,878
|
|
16
|
+
impact_factor/util/excel_parser.py,sha256=v3fVAuhJh8tCrKhSvcEnBdhIkpNkHg3spKPvGHcfkAg,1204
|
|
17
|
+
impact_factor-1.1.3.dist-info/METADATA,sha256=ncoZYPZkY5bx2F_uUctMR7JyxqnimoO8T-C5YoQM5uE,3182
|
|
18
|
+
impact_factor-1.1.3.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
19
|
+
impact_factor-1.1.3.dist-info/entry_points.txt,sha256=9rttypvqMbdsY8U-EcXn0O8wwQeOV1f-t0J_sx5o9EY,93
|
|
20
|
+
impact_factor-1.1.3.dist-info/top_level.txt,sha256=U32tP-Jpxs_YFYbWcRKpFd571Y9-XW9qKq61_ki69pY,14
|
|
21
|
+
impact_factor-1.1.3.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
impact_factor
|