Skip to content

Commit fc2403d

Browse files
author
lucasgit13
committed
add readme
1 parent 096f0ac commit fc2403d

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

Get-Dir-Github-Repo/README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Have you ever thought how do I download just a subdirectory from a Github repository? Yes? So this is the solution!
2+
3+
*Get* (I should take a better name..) is a *"multithreaded"* python script for dealing with a common problem that sometimes I pass through, get just some files from a repo whithou having to clone the whole repo.
4+
5+
## Installation
6+
7+
1. Download [get.py](https://raw.githubusercontent.com/larymak/Python-project-Scripts/main/Get-Dir-Github-Repo/get.py).
8+
9+
## Requirements
10+
The script will check if the required modules are installed, if not it will try install them. If it fails, you will have to manually install them. Get.py for now only have one module that not comes with python by default, *Requests*. *__Make sure you have python 3 proprely installed on your system.__*
11+
12+
Download [requirements.txt](https://raw.githubusercontent.com/larymak/Python-project-Scripts/main/Get-Dir-Github-Repo/requirements.txt) and run:
13+
14+
```
15+
python3 -m pip install -r requirements.txt
16+
```
17+
18+
## Usage
19+
```cmd
20+
python3 get.py [URL] [OPTIONAL ARGS]
21+
```
22+
Let's say you want get some files from a repo: *https://github.com/user/repo*.
23+
```
24+
repo/
25+
test/
26+
build/
27+
src/
28+
file1.py
29+
file2.py
30+
file3.py
31+
file4.py
32+
file5.py
33+
file6.py
34+
file.json
35+
file.yaml
36+
README.md
37+
.gitiginore
38+
```
39+
When providing a valid and public github repository, the script will get the files that list on the current directory get from the url, all subdirectories will be ignored.
40+
41+
```cmd
42+
python3 get.py https://github.com/user/repo
43+
```
44+
A directory with the name of the repo will be create on working directory on your file system:
45+
```
46+
repo/
47+
file1.py
48+
file2.py
49+
file3.py
50+
file4.py
51+
file5.py
52+
file6.py
53+
file.json
54+
file.yaml
55+
README.md
56+
.gitiginore
57+
```
58+
### If I want filter the files?
59+
No problem, you can use the flags *--include-only or -I and --exclude or -E* for filter the files you want and don't want with glob search pattern.
60+
61+
```cmd
62+
python3 get.py https://github.com/user/repo -I *.py
63+
```
64+
```cmd
65+
python3 get.py https://github.com/user/repo -E *.md .*
66+
```
67+
#### For more information run:
68+
```cmd
69+
python3 get.py --help
70+
```
71+

0 commit comments

Comments
 (0)