Skip to main content

Provides the default template for creating Python Package.

Project description

Team Connector CLI

Overview

teamconnector is a command-line tool for interacting with various cloud storage and remote server platforms. It provides a simple and unified interface for managing files and directories across different platforms, making it easier to work with data in a distributed environment.

Installation

Before installing teamconnector, make sure you create a Conda environment for your project. If you have our team Makefile, you can use the make create-env command to create a Conda environment.

To install teamconnector, you can use pip:

pip install teamconnector

User-specific parameters

To use the Team Connector CLI, you need to set the following environment variables:

  • REMOTE_USER: The username for the remote cluster filesystem.
  • REMOTE_HOST: The hostname for the remote cluster filesystem.
  • GOOGLE_ROOT: The root directory for your Google Drive.
  • MY_DRIVE: The path to your Google Drive's "My Drive" folder.
  • SHARED_DRIVE: The path to your Google Drive's "Shared Drives" folder.
  • ONE_DRIVE: The path to your OneDrive folder.

The following environment variables can be set in your bash profile (~/.bash_profile on Mac; ~/.bashrc in Unix).

However, I suggest you create an .env file in your root directory (~) with the following:

HOME=/Users/[Your_Username]
REMOTE_USER=[Your_Remote_Username]
REMOTE_HOST=[Your_Remote_Host]
REMOTE_DIR=/gpfs/commons/groups/[Your_Group_Name]
GOOGLE_ROOT="/Users/[Your_Username]/Library/CloudStorage/[Your_GoogleDrive_Account]"
MY_DRIVE="/Users/[Your_Username]/Library/CloudStorage/[Your_GoogleDrive_Account]/My Drive"
SHARED_DRIVE="/Users/[Your_Username]/Library/CloudStorage/[Your_GoogleDrive_Account]/Shared Drives"
ONE_DRIVE="/Users/[Your_Username]/Library/CloudStorage/[Your_OneDrive_Account]"
SLACK_USER_ID=[Your_Slack_User_ID]
SLACK_BOT_TOKEN=[Your_Slack_Bot_Token]

Within your conda environment, run tcinit ~ to load all the parameters into your conda environment.

Project-specific parameters

To configure your Conda environment, you'll need to set a few environment variables:

  1. CLOUD_ROOT: This is the base name of your Google bucket. For example, if your Google bucket URL is gs://gpc_array, then CLOUD_ROOT should be set to gs://gpc_array.

  2. PROJECT_ROOT: This is the absolute path to your local project folder. Replace <user> with your username. For example, if your project is in the /User/<user>/projects/gpc_array folder, set PROJECT_ROOT accordingly.

You can set these variables using the following command:

conda env config vars set CLOUD_ROOT=gs://gpc_array PROJECT_ROOT=`pwd`

Additional Configuration for datatracker

If you're using datatracker and find yourself in more complex scenarios, you'll also need to set:

  1. TRACKER_PATH: This is the absolute path to the db.json file within your project. You can dynamically set this to the db.json file in your project folder using the $PROJECT_ROOT variable you've already set.

Execute the following command to set TRACKER_PATH:

conda env config vars set TRACKER_PATH=$PROJECT_ROOT/db.json

Usage

Environment Configuration

Use tc config to display all the environment variables currently described in your ~/.bashrc or Conda environment. To identify which environment variables must be configured for the connector to operate properly, run tc -h.

File Operations from Local to Google Drive

List Files and Folders

  • Use tc drive -ls to list all files and folders in your Google Drive Shared directory.
  • Use tc drive -ls -t personal to list all files and folders in your Google Drive "Personal" directory.

Open Directories

  • tc drive -o -p aouexplore opens the "aouexplore" shared drive in your Google Drive.
  • tc drive -o -p aouexplore -s sample_qc opens the "sample_qc" folder in the "aouexplore" shared drive.

Upload Files and Folders

  • tc --debug drive --dir up --subdir sample_qc uploads the "sample_qc" folder to the parent directory of your Google Drive root directory, while enabling debug mode.
  • tc drive --dir up --subdir sample_qc performs the same upload operation without debug mode.

File Operations from Local to Google Cloud

Environment Setup

You need to set the CLOUD_ROOT variable both within your Makefile and Conda environment.

List and Download Files

  • tc gcp -ls lists all the files and folders in the Google Cloud Storage bucket specified in CLOUD_ROOT.
  • tc -n gcp --dir down --subdir phenotypes downloads the "phenotypes" folder from your Google Cloud Storage bucket to your local machine.

File Operations from Remote Server to Local

  • tc remote -r /gpfs/commons/groups/[Your_Group_Name]/projects/[Your_Project_Name]/ --dir down --subdir preprocessing downloads the "preprocessing" folder from the specified remote server directory to your local machine.

Replace the placeholder values with your specific information where needed.

Cite

Maintainer

Tarjinder Singh @ ts3475@cumc.columbia.edu

Acknowledgements

Release Notes

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

teamconnector-0.1.8.tar.gz (29.4 kB view details)

Uploaded Source

Built Distribution

teamconnector-0.1.8-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file teamconnector-0.1.8.tar.gz.

File metadata

  • Download URL: teamconnector-0.1.8.tar.gz
  • Upload date:
  • Size: 29.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for teamconnector-0.1.8.tar.gz
Algorithm Hash digest
SHA256 81d5c4488ac83a9c2a5b3aebc5a1a2fb899eb775655030fba52731dcffbe82a6
MD5 33dc0a1117aaa4f1fe2e0a35b2616589
BLAKE2b-256 007a30fc1a571418764f92703ccdc439a1f1e31498f53a887a1e71c6260155a8

See more details on using hashes here.

File details

Details for the file teamconnector-0.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for teamconnector-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 1d299302a6a40def6029b54f16235e1e43db8b79489ae0e274a3354984634028
MD5 5beb431bfe65bb560539a68f9bda7a21
BLAKE2b-256 28a04a354f40ca7c6fb4b80c345fec0ed7b327825eda8a2fe29458a0a69dcaa5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page