GithubHelp home page GithubHelp logo

wkentaro / gshell Goto Github PK

View Code? Open in Web Editor NEW
105.0 3.0 13.0 12.51 MB

Navigate in Google Drive as you do on shell (gshell = Google Drive + Shell).

License: MIT License

Python 95.83% Shell 4.17%
google-apps python

gshell's Introduction

gshell = Google Drive + Shell

Navigate in Google Drive as you do on shell.

Installation

pip install gshell

gshell init  # login to your google account

Usage

$ gshell info --with-id 0B9P1L--7Wd2vaGl4bDZaV2lESTQ
Id: 0B9P1L--7Wd2vaGl4bDZaV2lESTQ
Name: 20160502_gdown
Path: 20160502_gdown
Mime: application/vnd.google-apps.folder
Created: 2016-05-02 00:17:25
Modified: 2017-12-23 01:56:42
Shared: True
ViewUrl: https://drive.google.com/open?id=0B9P1L--7Wd2vaGl4bDZaV2lESTQ

$ gshell cd --with-id 0B9P1L--7Wd2vaGl4bDZaV2lESTQ

$ gshell pwd
20160502_gdown

$ gshell ll
Id                             Name                 Type   Size     Created
0B9P1L--7Wd2vT3Zxem1OdTMtWU0   gdown-1.0.2.tar.gz   bin    1.9 KB   2016-05-02 00:24:49
0B9P1L--7Wd2vU3VUVlFnbTgtS2c   spam.txt             bin    5.0 B    2016-05-02 00:19:31

$ gshell download spam.txt
Downloading spam.txt -> spam.txt
Downloaded 0B9P1L--7Wd2vU3VUVlFnbTgtS2c at 5.0 B/s, total 5.0 B

$ cat spam.txt
spam

Commands

Usage: gshell [OPTIONS] COMMAND [ARGS]...

Options:
  -V, --version  Show the version and exit.
  --help         Show this message and exit.

Commands:
  about     show account status
  cd        change directory
  download  download file
  info      show file information
  init      initialize gshell
  ll        list files in detail
  ls        list files
  mkdir     make directory
  open      open current site on browser
  pwd       print current working directory
  rm        remove file
  share     share file
  switch    switch user
  upload    upload file

gshell's People

Contributors

avatar-lavventura avatar crazyfin9ers avatar mmurooka avatar wkentaro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gshell's Issues

YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.

I keep getting following warning message on each call. Is there any way to suppress or fix it?

$ gshell info "name='ac555978d34be39d6b0fde9deb6c7d79'"
/home/alper/.local/lib/python2.7/site-packages/gshell/__init__.py:100: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  return yaml.load(open(CONFIG_FILE))
/home/alper/.local/lib/python2.7/site-packages/gshell/__init__.py:62: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  config = yaml.load(open(CONFIG_FILE))
directory name='ac555978d34be39d6b0fde9deb6c7d79' does not exist

[feature request] Can we add `--continue` to resume from partially-downloaded file using gshell?

My main question is can gshell continue downloading from where it left off like gdown does?

In order to download a large file from Google Drive, would it be possible to use gdown's solution inside gshell in order to download large data file?


Example approach is done in curl (https://stackoverflow.com/a/47343997/2402577) and gdown with-resume.

Use "-C -" to tell curl to automatically find out where/how to resume the transfer. It then uses the given output/input files to figure that out.

Error running gshell commands - IndexError: list index out of range.

Hello

I am getting below given errors on executing gshell commands like gshell cd --with-id FILEID. Only commands that work is, gshell init or gshell info --with-id FILEID. Otherwise I am always getting these errors.

I tried on Centos 7 & Ubuntu 20. In an older instance of Centos 7, I was able to execute all commands and get results, which has the same Python versions as in the latest Centos 7 spin up instances. Could you please share some light on what could be wrong?

Traceback (most recent call last):
File "/home/centos/.local/bin/gshell", line 8, in
sys.exit(main())
File "/home/centos/.local/lib/python3.6/site-packages/gshell/init.py", line 543, in main
cli()
File "/home/centos/.local/lib/python3.6/site-packages/click/core.py", line 1128, in call
return self.main(*args, **kwargs)
File "/home/centos/.local/lib/python3.6/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/home/centos/.local/lib/python3.6/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/centos/.local/lib/python3.6/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/centos/.local/lib/python3.6/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/home/centos/.local/lib/python3.6/site-packages/gshell/init.py", line 407, in cmd_cd
cwd = getcwd()
File "/home/centos/.local/lib/python3.6/site-packages/gshell/init.py", line 106, in getcwd
return init_config()
File "/home/centos/.local/lib/python3.6/site-packages/gshell/init.py", line 97, in init_config
home_id = _get_home_id()
File "/home/centos/.local/lib/python3.6/site-packages/gshell/init.py", line 89, in _get_home_id
parent_id = lines[1][start:end].strip()
IndexError: list index out of range

Ubuntu:

Traceback (most recent call last):
File ".local/bin/gshell", line 8, in
sys.exit(main())
File "/home/ubuntu/.local/lib/python3.8/site-packages/gshell/init.py", line 543, in main
cli()
File "/usr/lib/python3/dist-packages/click/core.py", line 764, in call
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/home/ubuntu/.local/lib/python3.8/site-packages/gshell/init.py", line 131, in cmd_init
config_dir = init(name)
File "/home/ubuntu/.local/lib/python3.8/site-packages/gshell/init.py", line 58, in init
init_config()
File "/home/ubuntu/.local/lib/python3.8/site-packages/gshell/init.py", line 97, in init_config
home_id = _get_home_id()
File "/home/ubuntu/.local/lib/python3.8/site-packages/gshell/init.py", line 89, in _get_home_id parent_id = lines[1][start:end].strip()
IndexError: list index out of range

Appreciate your help on this. Thank you.

Sign in disabled

I get the following message when trying to log in:
image

Is there an additional app verification step that needs to be done with google?

Fail to download. File not Found.

Failed to download even though the file can find with ls.
Maybe this problem began to occur after update within one month.

leus@cygnus:/media/leus/Murooka_1TB/compressed$ gshell ls
gazebo_object_motion_small_manip_10000.tgz
gazebo_object_motion_small_10000_split.tgz
gazebo_object_motion_small_10000.tgz
gazebo_object_motion_scalable_cube_2722.tgz
gazebo_object_motion_cf2_10000.tgz
gazebo_object_motion_10000_split.tgz
gazebo_object_motion_cf_10000.tgz
gazebo_object_motion_f_10000.tgz
gazebo_object_motion_c_10000.tgz
movie
gazebo_object_motion_v_10000.tgz
gazebo_object_motion_70000.tgz
gazebo_object_motion_10000.tgz
gazebo_object_motion_1
gazebo_object_motion_2000_20161025
gazebo_object_motion_2000
gazebo_object_motion_100
leus@cygnus:/media/leus/Murooka_1TB/compressed$ gshell download gazebo_object_motion_small_manip_10000.tgz
Failed to get file: googleapi: Error 404: File not found: None., notFound

Access blocked: project-367116221053โ€™s request is invalid

Hope this is not an error from the application. But I'm getting this when trying to init the session after opening the link:

Error 400: invalid_request
The out-of-band (OOB) flow has been blocked in order to keep users secure. Follow the Out-of-Band (OOB) flow migration guide linked in the developer docs below to migrate your app to an alternative method.
Request details: redirect_uri=urn:ietf:wg:oauth:2.0:oob
Related developer documentation

[google] This app is blocked

I keep having following error when I ran: gshell about, is there any way to handle this barrier to get the token id?

This app is blocked

This app tried to access sensitive info in your Google Account. To keep your account safe, Google blocked this access.

Url API call

Hi, where i can found the url API call?

Thanks

gshell code - throwing error message

Hello.
Every time I try to execute the init command switch for gshell, I get the following error:

cleitols@os:~$ gshell init
Traceback (most recent call last):
File "/usr/local/bin/gshell", line 8, in
sys.exit(main())
File "/home/cleitols/.local/lib/python3.9/site-packages/gshell/init.py", line 443, in main
cli()
File "/usr/lib/python3/dist-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/cleitols/.local/lib/python3.9/site-packages/gshell/init.py", line 125, in cmd_init
config_dir = init(name)
File "/home/cleitols/.local/lib/python3.9/site-packages/gshell/init.py", line 54, in init
init_config()
File "/home/cleitols/.local/lib/python3.9/site-packages/gshell/init.py", line 92, in init_config
home_id = _get_home_id()
File "/home/cleitols/.local/lib/python3.9/site-packages/gshell/init.py", line 84, in _get_home_id
parent_id = lines[1][start:end].strip()
IndexError: list index out of range

Source code of the binaries included in the project

Hi and thank you for this wonderful tool! it looks like the standard operation of it executes an executable, and I was looking for where are these executables built from, just to be on the safe side about what code is running as part of this tool. Perhaps someone can point me in the right direction after I have not succeeded in figuring that out myself from the project files on a first pass. Thanks in advance!

cannot find --skip and --force flag during download.

Hi, I got an error that
File '<>' already exists, use --force to overwrite or --skip to skip while resuming download.

When I tried to use skip flag as follows :
gshell download --with-id <> --recursive --force

I got an error that Error: no such option: --skip, and there is no description about skip and force flag on ghsell download -h

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.