ReQUIAM_csv package¶
Submodules¶
commons
module¶
-
requiam_csv.commons.
no_org_code_index
(df)¶ Identify entries without an Org Code. This is based on whether the value is set to NaN
- Parameters
df (
DataFrame
) – Research Themes dataframe- Return type
ndarray
- Returns
Array containing elements
create_csv
module¶
-
requiam_csv.create_csv.
create_csv
(url, outfile, log)¶ Generates a list of organization codes and associated portals for figshare account management.
The initial spreadsheet, which is curated by UA Libraries, is provided through the [url] input.
The exported CSV file will be placed in this git repo. Current path and file preference:
requiam_csv/data/research_themes.csv
- Parameters
url (
str
) – Full url to CSVoutfile (
str
) – Exported file in CSV formatlog (
Logger
) – Logger object
inspect_csv
module¶
-
requiam_csv.inspect_csv.
inspect_csv
(df, log)¶ Inspects Google Sheet CSV-export table to identify issues. Minor issues are logged. Major issues prevent creating the final CSV file.
- Minor issues include:
Entries without an ‘Org Code’ (i.e., empty rows). Minor because it is excluded in final export
- Major issues include:
Duplicate entries based on Org Code
Invalid/incorrect entries in ‘Departments/Colleges/Labs/Centers’ This result in not getting a proper Org Code
Missing ‘Research Themes’ or Sub-portals if either one is provided
- Parameters
df (
DataFrame
) – Research Themes dataframelog (
Logger
) – Logger object
logger
module¶
-
class
requiam_csv.logger.
LogClass
(log_dir, logfile)¶ Bases:
object
Main class to log information to stdout and ASCII logfile
- To use:
log = LogClass(log_dir, logfile).get_logger()
- Parameters
log_dir (
str
) – Relative path for exported logfile directorylogfile (
str
) – Filename for exported log file
-
get_logger
()¶ - Return type
Logger