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

Addition of File organizer snippet #11

Merged
merged 16 commits into from
Oct 5, 2024

Conversation

priyanka350
Copy link
Contributor

Issue Title : [Documentation Update]: Addition of File organizer snippet

  • Info about the related issue (Aim of the project) : Addition of file organizer pysnippet under pysnippets
  • Name: Priyanka Kumari
  • GitHub ID: https://github.com/priyanka350
  • Email ID: priyanka.tmsl2022@gmail.com
  • Identify yourself: (Mention in which program you are contributing. Eg. For a WoB 2024 participant, it's WoB Participant) Gssoc extd. Contributor

Closes: #9


Snippet Details 📃

  • Snippet Name: file_organizer.py
  • Category: File_Organizer
  • Function Name: organize_files_by_type

Summary of Changes

  • The organize_files_by_type snippet sorts files in a specified directory into categorized subfolders like 'Images', 'Documents', and 'Videos', enhancing file organization and accessibility.
  • Users must ensure the folder path exists, as the function raises a ValueError for invalid paths. Unrecognized file types will be noted, helping users identify files that weren't categorized.

Example Usage

# Example usage of the organize_files_by_type function
folder_to_organize = r"path_to_the_folder"  # Replace with the actual folder path
try:
    organize_files_by_type(folder_to_organize)
    print("Files organized successfully.")
except ValueError as e:
    print(e)

Type of Change ☑️

What sort of change have you made:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, local variables)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested? ⚙️

  • The organize_files_by_type function was tested using the unittest framework with a temporary directory containing various file types to ensure accurate categorization into appropriate folders. It also confirmed that unrecognized files remained in the root directory and validated error handling for invalid paths.
  • Changes were verified by executing all tests successfully, conducting a code review and performing manual tests to confirm proper file organization.

Checklist ☑️

  • My code follows the guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly where it was hard to understand.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • Any dependent changes have been merged and published in downstream modules.

Copy link
Contributor

github-actions bot commented Oct 5, 2024

👋 Thank you for opening this pull request! We're excited to review your contribution. Please give us a moment, and we'll get back to you shortly!

Feel free to join our community on Discord to discuss more!

@github-actions github-actions bot requested a review from UTSAVS26 October 5, 2024 11:05
@UTSAVS26 UTSAVS26 added documentation Improvements or additions to documentation good first issue Good for newcomers hacktoberfest Issues or PRs that qualify for Hacktoberfest contributions. hacktoberfest-accepted Pull requests that are accepted for Hacktoberfest contributions, even if not merged. Contributor level1 gssoc-ext labels Oct 5, 2024
@UTSAVS26 UTSAVS26 merged commit 9c75730 into UTSAVS26:main Oct 5, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contributor documentation Improvements or additions to documentation good first issue Good for newcomers gssoc-ext hacktoberfest Issues or PRs that qualify for Hacktoberfest contributions. hacktoberfest-accepted Pull requests that are accepted for Hacktoberfest contributions, even if not merged. level1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Documentation Update]: Addition of File organizer snippet
2 participants