Code Monkey home page Code Monkey logo

gitdir's People

Contributors

astronomyk avatar frcl avatar madoshakalaka avatar philippeitis avatar sdushantha avatar zenyusy 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  avatar  avatar  avatar  avatar

gitdir's Issues

document running with python3

hi
I followed the instructions as i found the concept interesting

when installed, whether with pip or pip3 as a none root account.

By default, 'file' is written in the MIFF image format.  To
specify a particular image format, precede the filename with an image
format name and a colon (i.e. ps:image) or specify the image type as
the filename suffix (i.e. image.ps).  Specify 'file' as '-' for
standard input or output.
import: delegate library support not built-in '' (X11) @ error/import.c/ImportImageCommand/1297.
/Users/abuxton/src/gitdir/gitdir.py: line 10: ERASE_LINE: command not found
/Users/abuxton/src/gitdir/gitdir.py: line 13: syntax error near unexpected token `('
/Users/abuxton/src/gitdir/gitdir.py: line 13: `def create_url(url):'

is output on running the command, also worth documenting ./gitdir.py the file will need to be executable.

the reson for the output is running without python3, osx default is not yet 3. pyenv or some such can be used to update system python default.

Does it work on Windows?

It would be nice if someone could test this out on WIndows and see if everything works perfectly, so that I can add to the README that gitdir supports Windows.

Command line accessible

Can you add the feature to call the script from the bash without the need to clone the repo.

Can't flatten and output_dir at same time

When trying to download all files from a nested dir, i want to output just the files to a single directory. However, it seems the flatten option just overrides the output directory and will just go to the current folder no matter what.

Here is the command I used:
python -m gitdir https://github.com/standardnotes/app/tree/main/packages/components/dist/zips -d zips -f

Getting error -> urllib.error.HTTPError: HTTP Error 403: Forbidden

Hi,

I tried using to download a folder as below and getting 403 Forbidden error. It is a public repository. Please clarify what are the other pre-requisite to run this.

F:\GitRepo\spring-hateaos>gitdir https://github.com/eugenp/tutorials/tree/master/spring-boot-rest
Traceback (most recent call last):
  File "f:\python\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "f:\python\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "F:\Python\Scripts\gitdir.exe\__main__.py", line 5, in <module>
  File "f:\python\lib\site-packages\gitdir\__main__.py", line 3, in <module>
    main()
  File "f:\python\lib\site-packages\gitdir\gitdir.py", line 150, in main
    total_files = download(url, flatten, args.output_dir)
  File "f:\python\lib\site-packages\gitdir\gitdir.py", line 64, in download
    response = urllib.request.urlretrieve(api_url)
  File "f:\python\lib\urllib\request.py", line 248, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
  File "f:\python\lib\urllib\request.py", line 223, in urlopen
    return opener.open(url, data, timeout)
  File "f:\python\lib\urllib\request.py", line 532, in open
    response = meth(req, response)
  File "f:\python\lib\urllib\request.py", line 642, in http_response
    'http', request, response, code, msg, hdrs)
  File "f:\python\lib\urllib\request.py", line 570, in error
    return self._call_chain(*args)
  File "f:\python\lib\urllib\request.py", line 504, in _call_chain
    result = func(*args)
  File "f:\python\lib\urllib\request.py", line 650, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

Thanks,
Ranga

Does it work for private repos?

I have access to my students's private repos, and i usually need to download specific folders of their repos. This tool seems great, but it apparently does not work with private repos (i do have access though).

Github master branch path begins at blob

i.e. https://github.com/sdushantha/gitdir/blob/master/gitdir.py.

As it stands, gitdir will fail if the branch path does not start in tree. It looks like this only happens (at least on Github) with the default repo branch.

Does not work on Windows?

I keep getting this error from any repository url.

The given url is a complete repository. Use 'git clone' to download the repository

Downloading a github folder into a specified directory

I'm trying to download a folder from github into a local directory. This is the code i'm running on command line:

gitdir --output_dir C:\Users\HP\Documents\datafolder https://github.com/Abba00/ImageDatasets/tree/main/SmallDataset

The command creates the "datafolder" directory but still downloads the github folder in it's own directory which isn't the desired result.
Please could you offer any help on this? It would be highly appreciated.

`gitdir` overwrites files without confirmation

Thanks for this tool! I accidentally overwrote some of my files earlier, and I think this is a preventable mistake.

https://github.com/sdushantha/gitdir/blob/0c071cca295907df216c93251803f5076cd82165/gitdir/gitdir.py#L103C17-L103C43

You can reproduce the problem with:

$ cd /tmp

$ gitdir https://github.com/sdushantha/gitdir/tree/master/gitdir
Downloaded: __init__.py
Downloaded: __main__.py
Downloaded: gitdir.py
✔ Download complete

$ echo "will be deleted" > gitdir/__main__.py

$ gitdir https://github.com/sdushantha/gitdir/tree/master/gitdir
Downloaded: __init__.py
Downloaded: __main__.py
Downloaded: gitdir.py
✔ Download complete

$ head gitdir/__main__.py
from .gitdir import main

main()

I'd propose adding a prompt to confirm, and a --force,-f flag

Can't download large amount of files from a folder

When trying to download a folder with many files, the github rate limit is reached too fast. Is it possible to download a folder in one request (zip file?) instead of requesting each files/folders in it?

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.