pythonpractice
Science Score: 18.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
○codemeta.json file
-
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Unable to calculate vocabulary similarity
Last synced: 10 months ago
·
JSON representation
·
Repository
Basic Info
- Host: GitHub
- Owner: mdsulemanr
- Language: Python
- Default Branch: master
- Size: 41 KB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Created almost 8 years ago
· Last pushed about 2 years ago
Metadata Files
Readme
Citation
README.md
pythonPractice
Owner
- Login: mdsulemanr
- Kind: user
- Repositories: 1
- Profile: https://github.com/mdsulemanr
Citation (citation.py)
path_to_file='/home/suleman/Downloads/citation.txt'
def citation(path_to_file):
f = open(path_to_file, 'r')
file = f.read()
ans=[]
sublist=''
i=0
while i < len(file):
if file[i]=='#' and file[i+1]=='*':
if sublist:
ans.append(sublist)
sublist=''
sublist+=file[i]
else:
sublist+=file[i]
i+=1
record=[]
for i in ans:
year_start=i.find('#t')
year=i[year_start+2:year_start+6]
name_start=i.find('#*')
name_end=i.find('#@')
name=i[name_start+2:name_end]
author_start=i.find('#@')
if i.find(' #t')!=-1:
author_end = i.find(' #t')
else:
author_end = i.find('#t')
author=i[author_start+2:author_end]
index_id_start=i.find('#index')
index_id=i[index_id_start+6:i.find('/n')-1]
publication_venue_start=i.find('#c')
if publication_venue_start!=-1:
publication_venue=i[publication_venue_start+2:i.find('#index')]
else:
publication_venue=''
record.append({index_id:{'name':name, 'author':author, 'publication_year':int(year), 'publication venue':publication_venue}})
return record
def paper_check(year1, year2):
number_of_papers=0
record = citation(path_to_file)
for dic in record:
for key in dic:
for i in dic[key]:
if i=='publication_year':
if dic[key][i] in range(year1, year2+1):
number_of_papers+=1
return number_of_papers
print(paper_check(1970, 1980))
print(paper_check(1981, 1990))
print(paper_check(1991, 2000))
print(paper_check(2001, 2010))
print(paper_check(2011, 2018))
print(paper_check(2009, 2018))
def co_authors(author):
record = citation(path_to_file)
authors_list=[]
for dic in record:
for key in dic:
for i in dic[key]:
if i=='author':
if author in dic[key][i]:
if ',' in dic[key][i]:
authors_list+=(dic[key][i].split(','))
authors_list.remove(author)
return authors_list
print(co_authors('Marc Sturm'))
def author_contribution(author, year):
record = citation(path_to_file)
ans=0
for dic in record:
for key in dic:
for i in dic[key]: #iterating keys
if dic[key][i]==year: #iterating values
if author in dic[key]['author']: #searching value
ans+=(1/100)*100
ans=str(ans)+str('%')
return ans
print(author_contribution('Hoon Hong', 2006))
def common_co_author(author1, author2):
common_author1 = co_authors(author1)
common_author2 = co_authors(author2)
all_commont_authors=[]
for i in common_author1:
if i in common_author2:
all_commont_authors.append(i)
return all_commont_authors
print(common_co_author('David Eppstein', 'Christian Scheideler'))
GitHub Events
Total
Last Year
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 0
- Total pull requests: 5
- Average time to close issues: N/A
- Average time to close pull requests: 2 minutes
- Total issue authors: 0
- Total pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 4
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
- mdsulemanr (5)