veoibd_synapse.cli package

Submodules

veoibd_synapse.cli.config module

Provide functions used in cli.config.

veoibd_synapse.cli.config.replace_config(name, factory_resets, prefix)[source]

Replace existing config file or generate initial one.

Backup existing file.

veoibd_synapse.cli.main module

Provide command line interface to the synapse manager.

veoibd_synapse.cli.main.setup_logging(conf_dict)[source]

Set up logging configurations.

veoibd_synapse.cli.pull module

Provide code devoted to downloading data from Synapse.

veoibd_synapse.cli.push module

Provide code devoted to uploading data to Synapse.

class veoibd_synapse.cli.push.BaseInteraction(info)[source]

Bases: object

Base class to manage information and execution for a single interaction with Synapse.

__init__(info)[source]

Initialize an Interaction.

More docs...

class veoibd_synapse.cli.push.Push(main_confs, user, push_config)[source]

Bases: object

Manage interactions with Synapse concerning adding/changing information on the Synapse servers.

_Push__base_info()

Return a fresh basic info tree for a new interaction to update.

__init__(main_confs, user, push_config)[source]

Initialize and validate basic information for a Push.

_build_remote_entity_dag()[source]

Build a DAG of the remote project structure.

_create_interactions()[source]

Create and store interaction objects based on the push_config.

_get_remote_entity_dicts()[source]

Query Synapse for all entity information related to this Project ID.

_process_push_config(push_config)[source]

Validate the value for ‘push_config’ and set ‘push_id’ and ‘push_time’.

_process_user(user, users)[source]

Validate the value for ‘user’.

execute()[source]

Execute the configured interactions.

login()[source]

Log in to Synapse and acquire the project entity.

class veoibd_synapse.cli.push.PushInteraction(info, push_obj)[source]

Bases: veoibd_synapse.cli.push.BaseInteraction

Manage information and execution for a single “push” interaction with Synapse.

__init__(info, push_obj)[source]

Initialize a PushInteraction.

Parameters:
  • info (dict-like) – Basic information tree.
  • push_obj (Push) – Pointer the host Push object.
_process_local_paths()[source]

Make sure that all local paths exist and convert them to Path()s.

_process_push_obj(push_obj)[source]

Make sure we have what we think we have.

add_file(loc_file)[source]

Create and add Synapse File object to DAG and upload to Synapse.

execute()[source]

Execute the push interaction.

prepare_destination()[source]

Get or create remote destination.

veoibd_synapse.cli.push.main(ctx, user, push_config)[source]

Consume a push-config file, execute described transactions, save record of transactions.

veoibd_synapse.cli.query module

Provide code devoted to querying Synapse.

veoibd_synapse.cli.syncdb module

Provide code devoted to retrieving and building the most up-to-date metadata database info from Synapse.

class veoibd_synapse.cli.syncdb.ProjectSubjectDatabase(main_confs, syn, project_id)[source]

Bases: veoibd_synapse.cli.syncdb.SubjectDatabase

Manage interactions with Synapse concerning accessing, downloading, and combining subject database files from a single Synapse Project.

__init__(main_confs, syn, project_id)[source]

Initialize and validate basic information.

Parameters:
  • main_confs (dict-like) – refernce to main configuration tree.
  • syn (Synapse) – an active synapse connection object.
  • project_id (str) – Synapse ID for a project.
get_db_files()[source]

Iterate through DB file IDs preforming sns.get(db_file_id) and storing in self.db_files.

retrieve_db_file_ids()[source]

Perform SQL query and return list of file.id values that are tagged with is_db=='true' for this project.

class veoibd_synapse.cli.syncdb.SubjectDatabase(main_confs, syn)[source]

Bases: object

Base class for managing interactions with Synapse concerning accessing, downloading, and combining subject database files from member-sites.

__init__(main_confs, syn)[source]

Initialize and validate basic information.

Extra information section

Parameters:
  • main_confs (dict-like) – refernce to main configuration tree.
  • syn (Synapse) – an active synapse connection object.
class veoibd_synapse.cli.syncdb.TeamSubjectDatabase(main_confs, syn, team_name)[source]

Bases: veoibd_synapse.cli.syncdb.SubjectDatabase

Manage interactions with Synapse concerning accessing, downloading, and combining subject database files from all member-sites in a Team.

__init__(main_confs, syn, team_name)[source]

Initialize and validate basic information.

Parameters:
  • main_confs (dict-like) – refernce to main configuration tree.
  • syn (Synapse) – an active synapse connection object.
  • team_name (str) – the name of a Synapse Team.
build_project_dbs()[source]

Iterate through project IDs building DB tables from each, storing the restults.

Stored as ProjectSubjectDatabase objects

combine_project_dbs()[source]

This has not yet been implemented.

Extra information section

Parameters:
  • param1 (type) – The first parameter.
  • param2 (type) – The second parameter.
Returns:

The return value. True for success, False otherwise.

Return type:

type

retrieve_team_project_ids()[source]

Retrieve info for all projects shared with self.team.id.

Uses the REST API and results are a multilevel dict-like object with two keys:
  • results (list of info dicts)
  • totalNumberOfResults (int)
Returns:None
veoibd_synapse.cli.syncdb.main(ctx, user, team_name)[source]

Module contents