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
🖍️This is a feature-complete clone of the awesome Chalk (JavaScript) library.

Terminal string styling done right This is a feature-complete clone of the awesome Chalk (JavaScript) library. All credits go to Sindre Sorhus. Highli

Fabian Keller 132 Dec 27, 2022
Convert markdown to HTML using the GitHub API and some additional tweaks with Python.

Convert markdown to HTML using the GitHub API and some additional tweaks with Python. Comes with full formula support and image compression.

phseiff 70 Dec 23, 2022
term2048 is a terminal-based version of 2048.

term2048 is a terminal-based version of 2048.

Baptiste Fontaine 798 Nov 21, 2022
Lets you view, edit and execute Jupyter Notebooks in the terminal.

Lets you view, edit and execute Jupyter Notebooks in the terminal.

David Brochart 684 Dec 28, 2022
Simple CLI tool to track your cryptocurrency portfolio in real time.

Simple tool to track your crypto portfolio in realtime. It can be used to track any coin on the BNB network, even obscure coins that are not listed or trackable by major portfolio tracking applicatio

Trevor White 69 Oct 24, 2022
A CLI Password Manager made using Python and Postgresql database.

ManageMyPasswords (CLI Edition) A CLI Password Manager made using Python and Postgresql database. Quick Start Guide First Clone The Project git clone

Imira Randeniya 1 Sep 11, 2022
Project scoped command execution to just do your work

Judoka is a command line utility that lets you define project scoped commands and call them through their alias. It lets you just do (= judo) your work.

Eelke van den Bos 2 Dec 17, 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
googler is a power tool to Google (web, news, videos and site search) from the command-line.

googler is a power tool to Google (web, news, videos and site search) from the command-line.

Terminator X 5.9k Jan 04, 2023
WebApp Maker make web apps (Duh). It is open source and make with python and shell.

WebApp Maker make web apps (Duh). It is open source and make with python and shell. This app can take any website and turn it into an app. I highly recommend turning these few websites into webapps:

2 Jan 09, 2022
Magnificent app which corrects your previous console command.

The Fuck The Fuck is a magnificent app, inspired by a @liamosaur tweet, that corrects errors in previous console commands. Is The Fuck too slow? Try t

Vladimir Iakovlev 75k Jan 02, 2023
CLI tool for one-line installation of C++/CMake projects.

cmakip When working on virtual environments, Python projects can be installed with a single command invocation, for example pip install --no-deps . .

Artificial and Mechanical Intelligence 4 Feb 15, 2022
Terminal-based keyboard testing

kbdtest kbdtest is a simple Python program that tests keyboard input using an interactive, terminal-based, visual keyboard display. It was originally

Ruunyox 12 Jul 19, 2022
PipeCat - A command line Youtube music player written in python.

A command line Youtube music player written in python. It's an app written for Linux. It also supports offline playlists that are stored in a

34 Nov 27, 2022
This project contains the ClonedPerson dataset and code described in our paper "Cloning Outfits from Real-World Images to 3D Characters for Generalizable Person Re-Identification".

ClonedPerson This is the official repository for the ClonedPerson project, which contains the ClonedPerson dataset and code described in our paper "Cl

Yanan Wang 55 Dec 27, 2022
A command line connect 4 game against a minimax agent.

A command line connect 4 game against a minimax agent.

1 Oct 17, 2021
RSS reader client for CLI (Command Line Interface),

rReader is RSS reader client for CLI(Command Line Interface)

Lee JunHaeng 10 Dec 24, 2022
dbt-subdocs is a python CLI you can used to generate a dbt-docs for a subset of your dbt project

dbt-subdocs dbt-subdocs is a python CLI you can used to generate a dbt-docs for a subset of your dbt project 🤔 Description This project is useful if

Jambe 6 Jan 03, 2023
GDBIGtools: A command line tools for GDBIG varaints browser

GDBIGtools: A command line tools for GDBIG varaints browser Introduction Born in Guangzhou Cohort Study Genome Research Database is based on thousands

广州市出生队列基因组学研究(The genomics study of BIGCS) 7 Sep 14, 2022
A very simple python script to encode and decode PowerShell one-liners.

PowerShell Encoder A very simple python script to encode and decode PowerShell one-liners. I used Raikia's PowerShell encoder ALOT, but one day it wen

John Tear 5 Jul 29, 2022