Sink is a CLI tool that allows users to synchronize their local folders to their Google Drives. It is similar to the Git CLI and allows fast and reliable syncs with the drive.

Overview

Sink

Sink is a CLI synchronisation tool that enables a user to synchronise local system files and folders with their Google Drives. It follows a git CLI like approach to facilitate straight-forward and easy synchronsiation. It uses the Google Drive API to interact with the Google Drive and OAuth to verify clients.

Installation

Install from zip file:

Download and extract the drive-sink-main folder to a suitable directory and run the following commands in that folder. (It is advised to install in a virutal environment)

  cd drive-sink-main
  pip install .

Install by cloning:

Set up a new folder and then clone the repo into the folder.

  git clone https://github.com/thakreyn/drive-sink.git
  cd drive-sink-main
  pip install .

After installation, run the command sink from the environment to use the tool.

Sink-main

Script Setup

In case of a virtual environment, one might use the script inside scripts folder by replacing the path inside the sink.bat with the path of sink.exe inside your env/scripts. And then add this script to your environment variables.

Assuming the path of env/scripts is : D:\Projects\trial\env\Scripts\sink.exe

@echo off

:: Replace the  with the absolute path of your env/scripts folder
:startsink  
D:\Projects\trial\env\Scripts\sink.exe %*

(NOTE: Above is applicable for windows only. Linux and Mac users need to create separate scripts)

Google Drive API Setup

As the application is based on the Google Drive API, in order to use it, you need to activate the Google Drive API for your account. Following are the steps to do so :

Enable Drive API for your account

After enabling the Drive API, you need to generate credentials for your account, the following article explains the steps to generate the credentials for your account.

Generate credentials for your account

After generating the credentials, download the .json file with credentials and rename it to credentials.json and paste it in the config folder 'after' initialising a directory.

Documentation

You can type in sink in your terminal or sink --help to see all the available commands available.

  • sink init : Initialise the folder and config details
  • sink initdrive : Verify credentials and sync files to drive
  • sink scan : Scans the directory for changes in files and folders
  • sink sync : Updates/commits the changes to the drive
  • sink log : Shows the commit log
  • sink status : Shows general config information
  • sink clean : Cleans (untracks) the given folder with option to delete drive folder as well

For further options for each command, type sink --help

Usage Demo

  1. In order to initialise a directory for synchronisation, we need to use the command sink init Sink init2
  2. (optional) You can list the files to be ignored in the ignore.txt inside .sink` folder. For ignoring folders, just use an '!' before the name.
    Sink ignore
  3. Then we paste the credentials.json file generated by Google inside the config folder in .sink.
    Sink Cred
  4. Then run sink initdrive to verify your credentials and initialise the directory on your drive. sink initdrive
  5. For just scanning the changes in the directory, we use sink scan Sink scan
  6. For syncing/commiting the changes to drive, we use the command sink sync. We can also the -m option along with sink sync to log a commit message. Sink sync
  7. To view commit messages, we can use the command sink log. Sink log can take in number of lines as an option (defalut = 5). Sink log
  8. sink status can be used to see te config details for the current directory Sink status

License

MIT

Authors

Contributing

Contributions are always welcome! Your feedback will help me grow as a developer and help me build better and more usable apps.

You might also like...
🐍The nx-python plugin allows users to create a basic python application using nx commands.
🐍The nx-python plugin allows users to create a basic python application using nx commands.

🐍 NxPy: Nx Python plugin This project was generated using Nx. The nx-python plugin allows users to create a basic python application using nx command

Juniper Command System is a Micro CLI Tool that allows you to manage your files, launch applications, as well as providing extra tools for OS Management.

Juniper Command System is a Micro CLI Tool that allows you to manage your files, launch applications, as well as providing extra tools for OS Management.

[WIP]An ani-cli like cli tool for movies and webseries

mov-cli A cli to browse and watch movies. Installation This project is a work in progress. However, you can try it out python git clone https://github

A python based command line tool to compare Github Users or Repositories

gitcomp A simple python package with a CLI to compare GitHub users and repositories by associating a git_score to each entry which is a weighted sum o

PathPicker accepts a wide range of input -- output from git commands, grep results, searches -- pretty much anything.After parsing the input, PathPicker presents you with a nice UI to select which files you're interested in. After that you can open them in your favorite editor or execute arbitrary commands. Command line util for grep.app - Search across a half million git repos
Command line util for grep.app - Search across a half million git repos

grepgithub Command line util for grep.app - Search across a half million git repos Grepgithub uses grep.app API to search GitHub repositories, providi

Trans is a dependency-free CLI for Google Translate

Trans is a dependency-free CLI for Google Translate

pypinfo is a simple CLI to access PyPI download statistics via Google's BigQuery.
pypinfo is a simple CLI to access PyPI download statistics via Google's BigQuery.

pypinfo: View PyPI download statistics with ease. pypinfo is a simple CLI to access PyPI download statistics via Google's BigQuery. Installation pypin

Comments
  • No need to delete file when Folder has been deleted already.

    No need to delete file when Folder has been deleted already.

    When a folder has been deleted first, then it's contents are moved to trash in the drive. But if the trash is cleared or disabled then it can raise an error

    enhancement 
    opened by thakreyn 1
  • OS: Source path for Linux is not working for saving credential.txt globally

    OS: Source path for Linux is not working for saving credential.txt globally

    I guess source path for is different for Linux and Windows. Please check and do update with the same!! You have done a great job!! very useful product for daily life and backup.

    opened by sujal0930 1
  • Drive Sync  during Update

    Drive Sync during Update

    There are 2 bugs that I have found during my test :

    1. During the sync of the folder, File name are not getting printed in the terminal
    2. If the folder is deleted in the drive and an edit has been made in the file, then the changes are not been shown. The file should have been uploaded once again. :)
    bug help wanted good first issue 
    opened by sachdev27 1
Releases(Stable)
Owner
Yash Thakre
Yash Thakre
CLI helper to install Github releases on your system.

gh-release-install is a CLI helper to install Github releases on your system. It can be used for pretty much anything, to install a formatter in your CI, deploy some binary using an orcherstration to

Jonas L. 28 Nov 06, 2022
Tiny command-line utility for mapping broken keys to other positions.

brokenkey Tiny command-line utility for mapping broken keys to other positions. Installation Clone this repository using git: git clone https://github

0 Oct 04, 2021
A Python module and command line utility for working with web archive data using the WACZ format specification

py-wacz The py-wacz repository contains a Python module and command line utility for working with web archive data using the WACZ format specification

Webrecorder 14 Oct 24, 2022
Command-line tool for downloading and extending the RedCaps dataset.

Command-line tool for downloading and extending the RedCaps dataset.

RedCaps dataset 33 Dec 14, 2022
pypyr task-runner cli & api for automation pipelines.

pypyr task-runner cli & api for automation pipelines. Automate anything by combining commands, different scripts in different languages & applications into one pipeline process.

pypyr 471 Dec 15, 2022
🖥️ A cross-platform modern shell.

Ergonomica WARNING: master on this repository is not the same as a stable release! Currently, this software is purely experimental, as I am cleaning i

813 Dec 27, 2022
A command line tool to create a graph representing your Ansible playbook tasks and roles

Ansible Playbook Grapher ansible-playbook-grapher is a command line tool to create a graph representing your Ansible playbook plays, tasks and roles.

Mohamed El Mouctar Haidara 424 Dec 20, 2022
Pymongo based CLI client, to run operation on existing databases and collections

Mongodb-Operations-Console Pymongo based CLI client, to run operation on existing databases and collections Program developed by Gustavo Wydler Azuaga

Gus 1 Dec 01, 2021
topalias - Linux alias generator from bash/zsh command history with statistics, written on Python.

topalias topalias - Linux alias generator from bash/zsh command history with statistics, written on Python. Features Generate short alias for popular

Sergey Chudakov 38 May 26, 2022
A very simple OpenContest command line client written in Python

OpenContest Client A very simple OpenContest command line client written in Python. The only dependency is the requests library. Tested with Linux onl

Ladue Computer Science 1 May 25, 2022
GanTTY - Project planning from the terminal

GanTTY - Project planning from the terminal

Timeo Sam Pochin 161 Dec 26, 2022
Euporie is a text-based user interface for running and editing Jupyter notebooks

Euporie is a text-based user interface for running and editing Jupyter notebooks

781 Jan 01, 2023
Command Line For Truecaller Written In Python

Truecaller-CLI Command Line Version For Truecaller Written In Python Never Login With A Number Over And Over Or It Will Be Banned Because Program Is S

Sandaru Ashen Fernando 16 Nov 08, 2022
CmdTube is a Python CLI library for searching, downloading, and watching YouTube tutorials

CmdTube is a Python CLI library for searching, downloading, and watching YouTube tutorials. This library was made with programmers in mind and it's dedicated to every programmer who watches YouTube v

Samuel Ayomide Ogunleke 2 Aug 22, 2022
Analysis of a daily word game "Wordle"

Wordle Analysis of a daily word game "Wordle" https://www.powerlanguage.co.uk/wordle/ Description Worlde is a daily word game in which a player attemp

Bartek 1 Feb 07, 2022
A simple terminal-based localhost chat application written in python

Chat House A simple terminal-based localhost chat application written in python How to Use? Clone the repo git clone https://github.com/heksadecimal/c

Heks 10 Nov 09, 2021
A terminal application for managing images and artifacts in Azure Container Registry.

acr-browser acr-browser is a terminal-based user interface for managing container images and artifacts in Azure Container Registry. 🚀 This project ow

Sam Dobson 5 Jul 30, 2022
A Yahtzee-solving python package and command line tool.

yahtzee A Yahtzee-solving python package and command line tool. The algorithm is mathematically guaranteed to have the best strategy. That is, it maxi

David Merrell 0 Aug 19, 2022
Zecwallet-Python is a simple wrapper around the Zecwallet Command Line LightClient written in Python

A wrapper around Zecwallet Command Line LightClient, written in Python Table of Contents About Installation Usage Examples About Zecw

Priveasy 2 Sep 06, 2022
ICMP Reverse Shell written in Python 3 and with Scapy (backdoor/rev shell)

icmpdoor - ICMP Reverse Shell icmpdoor is an ICMP rev shell written in Python3 and scapy. Tested on Ubuntu 20.04, Debian 10 (Kali Linux), and Windows

Jeroen van Kessel 206 Dec 29, 2022