rse.main package

Subpackages

Submodules

rse.main.criteria module

Copyright (C) 2020 Vanessa Sochat.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

rse.main.criteria.get_criteria()[source]

Get criteria from the default endpoint.

rse.main.taxonomy module

Copyright (C) 2020 Vanessa Sochat.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

rse.main.taxonomy.get_taxonomy()[source]

Get taxonomy from the default endpoint.

Module contents

Copyright (C) 2020 Vanessa Sochat.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

class rse.main.Encyclopedia(config_file=None, database=None, generate=False)[source]

Bases: object

An encyclopedia is one or more namespaces to store research software. By default, we create a structure on the filesystem, however an sqlite database (or other) can be used.

add(uid, quiet=False)[source]

A wrapper to add a repository to the software database.

analyze(repo, cthresh=0.5, tthresh=1, taxonomy_uids=None, criteria_uids=None)[source]

analyze takes a repository and calculates a “final answer” based on user provided thresholds

analyze_bulk(cthresh=0.5, tthresh=1, taxonomy_uids=None, criteria_uids=None, include_empty=False)[source]

analyze takes a repository and calculates a “final answer” based on user provided thresholds

annotate(username, atype, unseen_only=True, repo=None, save=False)[source]

Annotate the encyclopedia, either for criteria or taxonomy. A username is required for the namespace.

Arguments:
  • username (str) : the user’s GitHub username

  • atype (str) : the annotation type

  • unseen_only (bool): annotate only items not seen by username

  • repo (str) : annotate a particular software repository

annotate_criteria(username, unseen_only=True, repo=None, save=False)[source]

Annotate criteria, meaning we iterate over repos and criteria that match the user request, namely to annotate unseen only, or just a particular repository. If the repository is specified, unseen_only is assumed False.

annotate_taxonomy(username, unseen_only=True, repo=None, save=False)[source]

Annotate taxonomy, meaning we iterate over repos and criteria that match the user request, namely to annotate unseen only, or just a particular repository. If the repository is specified, unseen_only is assumed False.

bulk_add(filename)[source]

Given a filename with a single list of repos, add each

bulk_update(filename, rewrite=False)[source]

Given a filename with a single list of repos, add each

clear(target=None, noprompt=False)[source]

clear takes a target, and that can be a uid, parser, or none We ask the user for confirmation.

exists(uid)[source]

based on a parser type and unique identifier, determine if software exists in the database

get(uid=None)[source]

A wrapper to get a repo id from the database. If an id is not provided, will return the last updated repo based on timestamp of file or database.

get_or_create(uid)[source]
import_criteria_annotation(input_file, username)[source]

Given a text file that has a bullet list of (some checked) criteria as might be generated in a GitHub issue, read in the file and the username to do an annotation. If a user has already done an annotation, his or her record is updated.

import_taxonomy_annotation(input_file, username)[source]

Given a text file that has a bullet list of (some checked) criteria as might be generated in a GitHub issue, read in the file and the username to do an annotation. If a user has already done an annotation, his or her record is updated.

initdb(database)[source]

setup the rse home (where the config directory is stored) and the database specification. If a database string is required (and not provided) alert the user and exit on error).

Arguments:
  • config_dir (str) : the configuration directory (home for rse)

  • database (str) : a string to specify the database setup

label(uid, key, value, force=False)[source]

Update an existing software repository with a specific label.

list(name=None)[source]

A wrapper to the database list_repos function. Optionally take a whole parser name (e.g., github) or just a specific uid. No parser indicates that we list everything.

list_criteria()[source]

Get a listing of criteria from the rse API

list_taxonomy()[source]

Get a listing of a flattened taxonomy from the rse API

repos_by_topics(topics)[source]

return a list of unique topics, optionally matching a pattern

save_criteria(repo)[source]

Given a repository that can be a handle to a filesystem entry or database, save the criteria

save_taxonomy(repo, username, uids)[source]

Given a repository that can be a handle to a filesystem entry or database, save the criteria

search(query, taxonomy=None, criteria=None)[source]

Search across commands and general metadata for a string of interest. We use regular expressions (re.search) so they are supported. Search is only available for non-filesystem databases.

summary(repo=None)[source]

Summarize metrics for the entire database if uid is not defined, or one specific repository.

topics(pattern=None)[source]

return a list of unique topics, optionally matching a pattern

update(uid, rewrite=False)[source]

Update an existing software repository.

yield_criteria_annotation_repos(username, unseen_only=True, repo=None)[source]

Given a username, repository, and preference for seen / unseen, yield a repository to annotate.

yield_taxonomy_annotation_repos(username, unseen_only=True, repo=None)[source]

Given a username, repository, and preference for seen / unseen, yield a repository to annotate.