# cloner
A tool to clone efficiently all the repos in an organization
[![PyPI](https://img.shields.io/pypi/v/wr-cloner)](https://pypi.org/project/wr-cloner/)
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/w0rmr1d3r/cloner)](https://github.com/w0rmr1d3r/cloner/releases)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/wr-cloner)
![GitHub last commit](https://img.shields.io/github/last-commit/w0rmr1d3r/cloner)
[![CI](https://github.com/w0rmr1d3r/cloner/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/w0rmr1d3r/cloner/actions/workflows/ci.yml)
[![PyPi downloads](https://img.shields.io/pypi/dm/wr-cloner?label=PyPi%20downloads)](https://pypistats.org/packages/wr-cloner)
## Install
_When installing from PyPi, use **wr-cloner**, cloner was already taken :sad:_
```bash
pip install wr-cloner
```
## Usage
_Note: If using cloner after cloning the project and not a PyPi package, add "python" at the start.
There's an example of that in the examples section._
```text
Usage: cloner [OPTIONS] GITHUB_ORGANIZATION
A tool to clone efficiently all the repos in an organization.
Options:
--version Show the version and exit.
--token TEXT GitHub token to read private repos. This
parameter is needed when cloning from a
GitHub Enterprise server.
--ghe TEXT GitHub Enterprise URL. It needs the
GITHUB_ORGANIZATION parameter to clone repos
from there and the TOKEN option as well.
--threads INTEGER Number of threads and processes to use. For
maximum threads and processes on the system,
use '--max-threads' [default: 4]
--logging [ERROR|WARNING|INFO|DEBUG]
Logging level [default: INFO]
--path TEXT Sets a path where to clone the repositories
(eg: ./another/path/)
--git-options TEXT Add options to the clone command (eg: --git-
options "--depth 1"). By default, clones
quietly (--quiet).
--max-threads If declared, uses the maximum available
threads and processes in the system. As per
physical cores on the system cpu.
--ignore-archived If declared, will ignore archived repos when
cloning.
--help Show this message and exit.
```
### Examples
```bash
# For github.com with 8 threads
cloner --threads 8 GITHUB_ORGANIZATION
# For github.com with the maximum threads on the system running
cloner --max-threads GITHUB_ORGANIZATION
# For GHE, default threads
cloner --ghe GHE_URL --token SUPER_SECURE_TOKEN GITHUB_ORGANIZATION
# Cloning with options
cloner --git-options "--depth 1" GITHUB_ORGANIZATION
```
### Examples if cloning the repo
```bash
# Install dependencies with
make install
# Adjust PYTHONPATH
export PYTHONPATH=$PYTHONPATH:.
# Use it
python cloner GITHUB_ORGANIZATION
```
## Contributing
Check the [CONTRIBUTING.md](CONTRIBUTING.md) file.
## Security
Follow the instructions in the [SECURITY.md](SECURITY.md) file.
## License
[MIT](https://github.com/w0rmr1d3r/cloner/blob/master/LICENSE)
## Other & Troubleshooting
Multithreading doesn't work to clone repos, since the `os.system` call is 1 for each PID. The splitting is done with
multithreading, the cloning with multiprocessing. Same amount of threads and processes.
[Windows usage and support](docs/WINDOWS.md)
## Star History
[![Star History Chart](https://api.star-history.com/svg?repos=w0rmr1d3r/cloner&type=Date)](https://star-history.com/#w0rmr1d3r/cloner&Date)
Raw data
{
"_id": null,
"home_page": "",
"name": "wr-cloner",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9.0",
"maintainer_email": "",
"keywords": "github,python,git,clone,organization,multiprocessing,multithreading,python3",
"author": "w0rmr1d3r",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/40/24/b969d3ba4ed080361cd7b3cec4b3523ac8c1a7747f85617611a29db72de4/wr-cloner-1.9.3.tar.gz",
"platform": null,
"description": "# cloner\n\nA tool to clone efficiently all the repos in an organization\n\n[![PyPI](https://img.shields.io/pypi/v/wr-cloner)](https://pypi.org/project/wr-cloner/)\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/w0rmr1d3r/cloner)](https://github.com/w0rmr1d3r/cloner/releases)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/wr-cloner)\n![GitHub last commit](https://img.shields.io/github/last-commit/w0rmr1d3r/cloner)\n[![CI](https://github.com/w0rmr1d3r/cloner/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/w0rmr1d3r/cloner/actions/workflows/ci.yml)\n[![PyPi downloads](https://img.shields.io/pypi/dm/wr-cloner?label=PyPi%20downloads)](https://pypistats.org/packages/wr-cloner)\n\n## Install\n\n_When installing from PyPi, use **wr-cloner**, cloner was already taken :sad:_\n\n```bash\npip install wr-cloner\n```\n\n## Usage\n\n_Note: If using cloner after cloning the project and not a PyPi package, add \"python\" at the start.\nThere's an example of that in the examples section._\n\n```text\nUsage: cloner [OPTIONS] GITHUB_ORGANIZATION\n\n A tool to clone efficiently all the repos in an organization.\n\nOptions:\n --version Show the version and exit.\n --token TEXT GitHub token to read private repos. This\n parameter is needed when cloning from a\n GitHub Enterprise server.\n --ghe TEXT GitHub Enterprise URL. It needs the\n GITHUB_ORGANIZATION parameter to clone repos\n from there and the TOKEN option as well.\n --threads INTEGER Number of threads and processes to use. For\n maximum threads and processes on the system,\n use '--max-threads' [default: 4]\n --logging [ERROR|WARNING|INFO|DEBUG]\n Logging level [default: INFO]\n --path TEXT Sets a path where to clone the repositories\n (eg: ./another/path/)\n --git-options TEXT Add options to the clone command (eg: --git-\n options \"--depth 1\"). By default, clones\n quietly (--quiet).\n --max-threads If declared, uses the maximum available\n threads and processes in the system. As per\n physical cores on the system cpu.\n --ignore-archived If declared, will ignore archived repos when\n cloning.\n --help Show this message and exit.\n```\n\n### Examples\n\n```bash\n# For github.com with 8 threads\ncloner --threads 8 GITHUB_ORGANIZATION\n\n# For github.com with the maximum threads on the system running\ncloner --max-threads GITHUB_ORGANIZATION\n\n# For GHE, default threads\ncloner --ghe GHE_URL --token SUPER_SECURE_TOKEN GITHUB_ORGANIZATION\n\n# Cloning with options\ncloner --git-options \"--depth 1\" GITHUB_ORGANIZATION\n```\n\n### Examples if cloning the repo\n\n```bash\n# Install dependencies with\nmake install\n# Adjust PYTHONPATH\nexport PYTHONPATH=$PYTHONPATH:.\n# Use it\npython cloner GITHUB_ORGANIZATION\n```\n\n## Contributing\n\nCheck the [CONTRIBUTING.md](CONTRIBUTING.md) file.\n\n## Security\n\nFollow the instructions in the [SECURITY.md](SECURITY.md) file.\n\n## License\n\n[MIT](https://github.com/w0rmr1d3r/cloner/blob/master/LICENSE)\n\n## Other & Troubleshooting\n\nMultithreading doesn't work to clone repos, since the `os.system` call is 1 for each PID. The splitting is done with\nmultithreading, the cloning with multiprocessing. Same amount of threads and processes.\n\n[Windows usage and support](docs/WINDOWS.md)\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=w0rmr1d3r/cloner&type=Date)](https://star-history.com/#w0rmr1d3r/cloner&Date)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A tool to clone efficiently all the repos in an organization",
"version": "1.9.3",
"project_urls": {
"Bug Tracker": "https://github.com/w0rmr1d3r/cloner/issues",
"Changelog": "https://github.com/w0rmr1d3r/cloner/releases",
"Documentation": "https://github.com/w0rmr1d3r/cloner",
"Funding": "https://github.com/sponsors/w0rmr1d3r",
"Homepage": "https://github.com/w0rmr1d3r/cloner",
"Repository": "https://github.com/w0rmr1d3r/cloner"
},
"split_keywords": [
"github",
"python",
"git",
"clone",
"organization",
"multiprocessing",
"multithreading",
"python3"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "98b0e7db5a5cb3a5447d85367b9c1d6c136f01f8357cb8a77c8f0eb819c603b6",
"md5": "fcd855215494481d81fe319f8d0a5a52",
"sha256": "70f33081e02e62b54da51c9d8111d82ec51d9fe8e2cc63b742c85f03c5655f62"
},
"downloads": -1,
"filename": "wr_cloner-1.9.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fcd855215494481d81fe319f8d0a5a52",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9.0",
"size": 12441,
"upload_time": "2023-10-18T14:20:40",
"upload_time_iso_8601": "2023-10-18T14:20:40.996125Z",
"url": "https://files.pythonhosted.org/packages/98/b0/e7db5a5cb3a5447d85367b9c1d6c136f01f8357cb8a77c8f0eb819c603b6/wr_cloner-1.9.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4024b969d3ba4ed080361cd7b3cec4b3523ac8c1a7747f85617611a29db72de4",
"md5": "a532eebcb734c4c5a134d97cf3df663a",
"sha256": "2109b03cd9cd962c88823e298e1dbe096d469b4d249a87cd15ff27fdcfe16bb1"
},
"downloads": -1,
"filename": "wr-cloner-1.9.3.tar.gz",
"has_sig": false,
"md5_digest": "a532eebcb734c4c5a134d97cf3df663a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9.0",
"size": 15991,
"upload_time": "2023-10-18T14:20:42",
"upload_time_iso_8601": "2023-10-18T14:20:42.680201Z",
"url": "https://files.pythonhosted.org/packages/40/24/b969d3ba4ed080361cd7b3cec4b3523ac8c1a7747f85617611a29db72de4/wr-cloner-1.9.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-18 14:20:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "w0rmr1d3r",
"github_project": "cloner",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "wr-cloner"
}