Skip to content

Commit

Permalink
Update project name and recursive download feature
Browse files Browse the repository at this point in the history
  • Loading branch information
rocktimsaikia committed Sep 1, 2024
1 parent e1fda7c commit c535adb
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 19 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Github-dl
# github-dlr

Download individual files and folders from Github.
Download individual files and folders from Github recursively.

[![Tests](https://github.com/rocktimsaikia/github-dl/actions/workflows/tests.yml/badge.svg)](https://github.com/rocktimsaikia/github-dl/actions/workflows/tests.yml)
[![Tests](https://github.com/rocktimsaikia/github-dlr/actions/workflows/tests.yml/badge.svg)](https://github.com/rocktimsaikia/github-dlr/actions/workflows/tests.yml)

## Motivation

Expand All @@ -11,39 +11,39 @@ The project aims to save time and resources by allowing users to download only t
## Install

```sh
pip install github-dl
pip install github-dlr
```

or using [pipx](https://pipx.pypa.io/)

```sh
pipx install cambd
pipx install github-dlr
```

## Usage

> [!NOTE]
> Using the tool is straightforward, copy the Github URL of the target repository folder and paste it after the command `github-dl` or it's alias `gh-dl`.
> Using the tool is straightforward, copy the Github URL of the target repository folder and paste it after the command `github-dlr` or it's alias `gh-dlr`.
```sh
github-dl <github_path>
github-dlr <github_path>

# Basic Example
github-dl https://github.com/linuxdotexe/nordic-wallpapers/tree/master/dynamic-wallpapers/Coast
github-dlr https://github.com/linuxdotexe/nordic-wallpapers/tree/master/dynamic-wallpapers/Coast
```

> [!NOTE]
> By default it will download the entire folder from Github and place in the current directory from where the command is being executed. If you want to specify a different output directory, you can do it via the `--output` or `-o` flag.
```sh
github-dl --output wallpapers https://github.com/linuxdotexe/nordic-wallpapers/tree/master/dynamic-wallpapers/Coast
github-dlr --output wallpapers https://github.com/linuxdotexe/nordic-wallpapers/tree/master/dynamic-wallpapers/Coast
```

\
Find all available options using `--help`

```sh
usage: github-dl [-h] [-o] [-v] github_path
usage: github-dlr [-h] [-o] [-v] github_path

Download folders and files from Github.

Expand All @@ -55,7 +55,7 @@ options:
-o , --output Destination directory to download to
-v, --version show program version number and exit

Thanks for using github-dl!
Thanks for using github-dlr!
```

## LICENSE
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions github_dl/console.py → github_dlr/console.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import argparse

from github_dl import __version__
from github_dl.source import main
from github_dlr import __version__
from github_dlr.source import main


def cli():
parser = argparse.ArgumentParser(
prog="github-dl",
prog="github-dlr",
description="Download folders and files from Github.",
epilog="Thanks for using github-dl (❁´◡`❁)",
epilog="Thanks for using github-dlr (❁´◡`❁)",
)

parser.add_argument(
Expand Down
File renamed without changes.
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[tool.poetry]
name = "github-dl"
name = "github-dlr"
version = "0.1.0"
description = "Download individual files and folders from Github"
homepage = "https://github.com/rocktimsaikia/github-dlr"
authors = ["Rocktim Saikia <rocktimthedev@gmail.com>"]
readme = "README.md"
keywords = ["download", "github", "directory", "gitdown"]
Expand All @@ -25,6 +26,6 @@ requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
github-dl = 'github_dl.console:cli'
gh-dl = 'github_dl.console:cli'
github-dlr = 'github_dlr.console:cli'
gh-dlr = 'github_dlr.console:cli'

2 changes: 1 addition & 1 deletion tests/source_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from github_dl.source import normalize_github_url
from github_dlr.source import normalize_github_url


def test_normalize_github_url():
Expand Down

0 comments on commit c535adb

Please sign in to comment.