Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

WoS Tab File

Extract information from the exported Web of Science's tab delimited text file

Installation

pip install wos-tabfile

Basic Usage

  1. Retrieve publication year and numbers of citations in different indicators.
from wostabfile.core import WosTabFile
from collections import OrderedDict

# data source
root_path = "data/social network"
file_path = root_path + "/part1.txt"

# header fields in the text file
# Tag from: https://images.webofknowledge.com/images/help/WOS/hs_wos_fieldtags.html
wos_fields = ["PY", "NR", "TC", "U1", "U2"]
# load data by specific keys
wtf = WosTabFile(file_path=file_path)

table = wtf.generate_table(wos_fields)

print()
# group by year using count for numbers of publications per year
new_table=wtf.group_by(table,key_index=0,value_index=1,method="count")
new_table = OrderedDict(sorted(new_table.items()))

print("Year\tNumber of publication")
for year in new_table:
    print(f'{year}\t{new_table[year]}')
  1. Retrieve keywords and its frequency from the bibliometric data
from wostabfile.core import WosTabFile
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import word_tokenize

root_path = "data/social network"
wos_fields = ["DE"]
wtf = WosTabFile(file_path=root_path)
dict_words={}

def singularize(text):
    wnl = WordNetLemmatizer()
    tokens = [token.lower() for token in word_tokenize(text)]
    lemmatized_words = [wnl.lemmatize(token) for token in tokens]
    return (' '.join(lemmatized_words)).strip()

def process_row(rows):
    global dict_words
    for ks in rows:
        wlist=ks[0]
        for w in wlist.split(";"):
            w=w.strip()
            if w=="":
                continue
            w=singularize(w)
            if w not in dict_words.keys():
                dict_words[w]=1
            else:
                dict_words[w]+=1

table = wtf.generate_table_by_folder(wos_fields,func=process_row)
dict_words =  dict(sorted(dict_words.items(),reverse=True, key=lambda item: item[1]))

print("Word\tTerm Count")
for k in list(dict_words.keys())[:20]:
    print(f'{k}\t{dict_words[k]}')
print()
print("Number of unique words: ",len(dict_words.keys()))

Sample bibliometric data in the above examples can be downloaded in this link.

License

The wos-tabfile project is provided by Donghua Chen.

Metadata

Release files for wos-tabfile 0.0.1a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wos-tabfile 0.0.1a1
File Size Uploaded
wos-tabfile-0.0.1a1.tar.gz 8.7 kB Details

Release files / wos-tabfile-0.0.1a1.tar.gz

Download URL wos-tabfile-0.0.1a1.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2cff64c480c1f52dc565ecd16c6da0909094f3c2e8083e63b293e2e75182063d
BLAKE2b-256 checksum
How to use checksums
2e20ebb4425b8f599e160ea84b440ec09a2d69102288bca007573160814b1ddd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6

Release history Release notifications | RSS feed

This release

0.0.1a1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page