Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UGithubDownloader + some functions and methods for downloading files and folders from repo or downloading all repo. #37

Merged
merged 31 commits into from
Jun 29, 2024

Conversation

bleudev
Copy link
Member

@bleudev bleudev commented Jun 27, 2024

TODO:

  • Functions, methods, class
  • Fixes and optimizations
  • Examples

closes #36

Summary by Sourcery

This pull request introduces new functionality for downloading files, folders, or entire repositories from GitHub using the UGithubDownloader class and associated functions. It also includes updates to the setup configuration and adds comprehensive documentation with examples.

  • New Features:
    • Introduced UGithubDownloader class for downloading files, folders, or entire repositories from GitHub.
    • Added functions file, folder, and repo for downloading specific resources from GitHub repositories.
    • Implemented UOpen class for handling file operations with automatic directory creation.
  • Enhancements:
    • Updated setup.py to include the new requests dependency and added the new github package.
  • Documentation:
    • Added examples/github/download.md to provide usage examples and documentation for the new GitHub downloading features.

@bleudev bleudev added new feature New feature new class New class new function New function labels Jun 27, 2024
@bleudev bleudev added this to the 1.0 milestone Jun 27, 2024
@bleudev bleudev self-assigned this Jun 27, 2024
@bleudev bleudev linked an issue Jun 27, 2024 that may be closed by this pull request
ufpy/github/__init__.py Outdated Show resolved Hide resolved
@bleudev bleudev marked this pull request as ready for review June 28, 2024 17:06
Copy link
Contributor

sourcery-ai bot commented Jun 28, 2024

Reviewer's Guide by Sourcery

This pull request introduces the UGithubDownloader class and associated functions for downloading files, folders, or entire repositories from GitHub. It also includes updates to the setup configuration and adds documentation with examples.

File-Level Changes

Files Changes
ufpy/github/download.py
ufpy/path/files.py
Introduced new classes and functions for downloading resources from GitHub and handling file operations.
setup.py Updated setup configuration to include new dependencies and package paths.
examples/github/download.md Added documentation with examples for the new GitHub downloading features.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Привет, @bleudev - я просмотрел ваши изменения, и они выглядят отлично!

Вот что я рассмотрел во время проверки
  • 🟡 Общие проблемы: найдено 7 проблем
  • 🟡 Безопасность: найдена 1 проблема
  • 🟢 Тестирование: все выглядит хорошо
  • 🟢 Сложность: все выглядит хорошо
  • 🟢 Документация: все выглядит хорошо

Sourcery бесплатен для open source - если вам нравятся наши обзоры, пожалуйста, подумайте о том, чтобы поделиться ими ✨
Помогите мне быть полезнее! Пожалуйста, нажмите 👍 или 👎 на каждый комментарий, чтобы сообщить, был ли он полезен.
Original comment in English

Hey @bleudev - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 7 issues found
  • 🟡 Security: 1 issue found
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

setup.py Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
ufpy/github/download.py Outdated Show resolved Hide resolved
ufpy/github/download.py Outdated Show resolved Hide resolved
ufpy/github/download.py Outdated Show resolved Hide resolved
ufpy/github/download.py Outdated Show resolved Hide resolved
ufpy/github/download.py Outdated Show resolved Hide resolved
ufpy/github/download.py Outdated Show resolved Hide resolved
ufpy/github/download.py Outdated Show resolved Hide resolved
ufpy/github/download.py Outdated Show resolved Hide resolved
@bleudev bleudev marked this pull request as draft June 28, 2024 20:06
@honey-team honey-team deleted a comment from sourcery-ai bot Jun 28, 2024
@bleudev bleudev marked this pull request as ready for review June 28, 2024 20:41
sourcery-ai[bot]
sourcery-ai bot previously approved these changes Jun 28, 2024
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @bleudev - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 5 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

ufpy/github/download.py Outdated Show resolved Hide resolved
ufpy/github/download.py Outdated Show resolved Hide resolved
ufpy/github/download.py Outdated Show resolved Hide resolved
ufpy/path/files.py Show resolved Hide resolved
ufpy/path/files.py Outdated Show resolved Hide resolved
ufpy/__init__.py Show resolved Hide resolved
ufpy/github/download.py Outdated Show resolved Hide resolved
ufpy/path/files.py Outdated Show resolved Hide resolved
@bleudev
Copy link
Member Author

bleudev commented Jun 28, 2024

@sourcery-ai review

sourcery-ai[bot]
sourcery-ai bot previously approved these changes Jun 28, 2024
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @bleudev - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

ufpy/github/download.py Outdated Show resolved Hide resolved
ufpy/github/download.py Show resolved Hide resolved
ufpy/path/files.py Outdated Show resolved Hide resolved
ufpy/__init__.py Show resolved Hide resolved
ufpy/github/download.py Outdated Show resolved Hide resolved
@bleudev
Copy link
Member Author

bleudev commented Jun 28, 2024

@sourcery-ai review

@bleudev
Copy link
Member Author

bleudev commented Jun 29, 2024

@sourcery-ai review

sourcery-ai[bot]
sourcery-ai bot previously approved these changes Jun 29, 2024
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @bleudev - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 5 issues found
  • 🟢 Security: all looks good
  • 🟢 Review instructions: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟡 Documentation: 5 issues found

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

setup.py Show resolved Hide resolved
ufpy/github/download.py Show resolved Hide resolved
ufpy/github/download.py Outdated Show resolved Hide resolved
ufpy/github/download.py Outdated Show resolved Hide resolved
ufpy/path/files.py Outdated Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
ufpy/__init__.py Show resolved Hide resolved
@bleudev
Copy link
Member Author

bleudev commented Jun 29, 2024

@sourcery-ai review

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @bleudev - I've reviewed your changes and found some issues that need to be addressed.

Blocking issues:

  • Potential security risk with extractall. (link)
Here's what I looked at during the review
  • 🟡 General issues: 5 issues found
  • 🔴 Security: 1 blocking issue
  • 🟢 Review instructions: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟡 Documentation: 7 issues found

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

setup.py Outdated Show resolved Hide resolved
ufpy/github/download.py Show resolved Hide resolved
ufpy/github/download.py Outdated Show resolved Hide resolved
ufpy/github/download.py Outdated Show resolved Hide resolved
ufpy/github/download.py Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
@bleudev
Copy link
Member Author

bleudev commented Jun 29, 2024

@sourcery-ai review

sourcery-ai[bot]
sourcery-ai bot previously approved these changes Jun 29, 2024
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @bleudev - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 6 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟡 Documentation: 4 issues found

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

setup.py Show resolved Hide resolved
setup.py Show resolved Hide resolved
ufpy/github/download.py Show resolved Hide resolved
ufpy/github/download.py Show resolved Hide resolved
ufpy/github/download.py Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
ufpy/__init__.py Show resolved Hide resolved
@bleudev
Copy link
Member Author

bleudev commented Jun 29, 2024

@sourcery-ai review

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @bleudev - I've reviewed your changes and found some issues that need to be addressed.

Blocking issues:

  • Check for potential directory traversal vulnerabilities. (link)
Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🔴 Security: 1 blocking issue
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟡 Documentation: 5 issues found

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

setup.py Show resolved Hide resolved
ufpy/github/download.py Show resolved Hide resolved
ufpy/github/download.py Show resolved Hide resolved
ufpy/github/download.py Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
examples/github/download.md Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
examples/github/download.md Show resolved Hide resolved
ufpy/__init__.py Show resolved Hide resolved
@bleudev
Copy link
Member Author

bleudev commented Jun 29, 2024

@sourcery-ai review

sourcery-ai[bot]
sourcery-ai bot previously approved these changes Jun 29, 2024
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @bleudev - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟡 Security: 1 issue found
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟡 Documentation: 5 issues found

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

ufpy/github/download.py Show resolved Hide resolved
ufpy/github/download.py Show resolved Hide resolved
ufpy/path/files.py Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
ufpy/__init__.py Show resolved Hide resolved
@bleudev
Copy link
Member Author

bleudev commented Jun 29, 2024

@sourcery-ai review

sourcery-ai[bot]
sourcery-ai bot previously approved these changes Jun 29, 2024
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @bleudev - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟡 Documentation: 7 issues found

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

ufpy/github/download.py Show resolved Hide resolved
ufpy/github/download.py Show resolved Hide resolved
ufpy/path/files.py Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
examples/github/download.md Show resolved Hide resolved
examples/github/download.md Show resolved Hide resolved
examples/github/download.md Show resolved Hide resolved
@bleudev
Copy link
Member Author

bleudev commented Jun 29, 2024

@sourcery-ai review

sourcery-ai[bot]
sourcery-ai bot previously approved these changes Jun 29, 2024
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @bleudev - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 6 issues found
  • 🟡 Security: 1 issue found
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟡 Documentation: 5 issues found

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

setup.py Show resolved Hide resolved
setup.py Show resolved Hide resolved
ufpy/github/download.py Show resolved Hide resolved
ufpy/github/download.py Show resolved Hide resolved
ufpy/github/download.py Show resolved Hide resolved
examples/github/download.md Show resolved Hide resolved
examples/github/download.md Outdated Show resolved Hide resolved
examples/github/download.md Show resolved Hide resolved
examples/github/download.md Show resolved Hide resolved
ufpy/__init__.py Show resolved Hide resolved
@bleudev
Copy link
Member Author

bleudev commented Jun 29, 2024

@sourcery-ai review

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @bleudev - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

ufpy/github/download.py Show resolved Hide resolved
ufpy/__init__.py Show resolved Hide resolved
@bleudev bleudev merged commit 14395c2 into main Jun 29, 2024
2 checks passed
@bleudev bleudev deleted the git-download branch June 29, 2024 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new class New class new feature New feature new function New function
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Download files from public github repo.
1 participant