Skip to content

Commit

Permalink
Merge pull request #6 from alan-turing-institute/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
J-A-Ha authored Sep 22, 2024
2 parents 76f8f88 + 365ee91 commit f2d223e
Show file tree
Hide file tree
Showing 71 changed files with 6,834 additions and 1,279 deletions.
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"python.analysis.typeCheckingMode": "off",
"python.analysis.autoImportCompletions": true
}
1 change: 1 addition & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

| Version | Supported |
| ------- | ------------------ |
| 1.1.0 | Yes |


## Reporting a Vulnerability
Expand Down
18 changes: 4 additions & 14 deletions art/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
Academic Review Tool (ART)
==========================
Version: 1.1.0
The Academic Review Tool (ART) is a package for performing academic reviews and bibliometric analyses in Python.
It offers capabilities for discovering, retrieving, and analysing academic literature at scale.
ART accesses records from Crossref, Web of Science, Scopus, Orcid, and more.
Expand All @@ -30,6 +32,7 @@
* Geopy / Nominatim
"""

from .utils.basics import open_file as open
from .importers.crossref import lookup_doi, lookup_dois, lookup_journal, lookup_journals, search_journals, get_journal_entries, search_journal_entries, lookup_funder, lookup_funders, search_funders, get_funder_works, search_funder_works
from .importers.crossref import search_works as search_crossref
# from .importers.wos import search as search_wos
Expand All @@ -39,17 +42,4 @@
# from .importers import pdf, orcid, crossref, scopus, jstor, wos
from .classes import Results, References, Author, Authors, Funder, Funders, Affiliation, Affiliations, Review
from .classes.networks import Network, Networks
from .classes.citation_crawler import academic_scraper as scrape

import pickle

def open_file(file_address: str = 'request_input'): # type: ignore

if file_address == 'request_input':
file_address = input('File address: ')

if (file_address.endswith('.txt')) or (file_address.endswith('.review')):
with open(file_address, 'rb') as f:
review = pickle.load(f)

return review
from .classes.citation_crawler import academic_scraper as scrape
Binary file added art/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file added art/classes/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added art/classes/__pycache__/attrs.cpython-39.pyc
Binary file not shown.
Binary file added art/classes/__pycache__/authors.cpython-39.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added art/classes/__pycache__/funders.cpython-39.pyc
Binary file not shown.
Binary file added art/classes/__pycache__/networks.cpython-39.pyc
Binary file not shown.
Binary file added art/classes/__pycache__/properties.cpython-39.pyc
Binary file not shown.
Binary file added art/classes/__pycache__/references.cpython-39.pyc
Binary file not shown.
Binary file added art/classes/__pycache__/results.cpython-39.pyc
Binary file not shown.
Binary file added art/classes/__pycache__/review.cpython-39.pyc
Binary file not shown.
42 changes: 32 additions & 10 deletions art/classes/activitylog.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,24 @@
class ActivityLog(pd.DataFrame):

"""
This is a ActivityLog object. It is a modified Pandas Dataframe object designed to store metadata about an academic review.
This is an ActivityLog object. It is a modified Pandas Dataframe object designed to store metadata about an academic review.
Parameters
----------
Attributes
----------
Columns
-------
* **timestamp**: date-time the activity occurred.
* **type**: type of activity.
* **activity**: details of activity.
* **location**: location in Review that activity occurred.
* **database**: name of database/repository accessed (if relevant).
* **url**: web address accessed (if relevant).
* **query**: search query used (if relevant).
* **changes**: number of changes made to the Review results.
"""

def __init__(self):

"""
Initialises ActivityLog instance.
Parameters
----------
"""


Expand All @@ -44,6 +45,27 @@ def __init__(self):

def add_activity(self, type: str, activity: str, location: list, database = None, query = None, url = None, changes_dict = None):

"""
Adds a new activity to the ActivityLog DataFrame.
Parameters
----------
type : str
type of activity.
activity : str
details of activity.
location : str
name of location in Review that activity occurred.
database : str
name of database/repository accessed (if relevant). Defaults to None.
query : str
search query used (if relevant). Defaults to None.
url : str
web address accessed (if relevant). Defaults to None.
changes_dict : dict
dictionary of changes made to Review. Defaults to None.
"""

new_index = len(self)
self.loc[new_index, 'timestamp'] = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
self.loc[new_index, 'type'] = type
Expand Down
Loading

0 comments on commit f2d223e

Please sign in to comment.