Skip to content

Added File Format Functionality#38

Merged
jfilter merged 2 commits into
jfilter:mainfrom
master-fury:main
Jan 27, 2026
Merged

Added File Format Functionality#38
jfilter merged 2 commits into
jfilter:mainfrom
master-fury:main

Conversation

@master-fury

@master-fury master-fury commented Jun 1, 2022

Copy link
Copy Markdown
Contributor

Files can be split based on the file extension specified. It is an optional argument and by default, it is set to None. For more details please read the updated readme.md #37

@govindbanura

Copy link
Copy Markdown

Hi @jfilter,

Just wanted to bring this PR to your attention again. I believe the ability to split folders based on file extensions (as implemented here) would be a valuable addition to the split-folders library, addressing the use case outlined in issue #37.

The code includes the implementation and also updates the readme.md to reflect the new functionality. I've tested it thoroughly.

Whenever you have a chance, I'd greatly appreciate it if you could review the changes and let me know if you have any feedback. Happy to address any concerns or make adjustments as needed.

Thanks again for your time!

@jfilter jfilter merged commit d149dea into jfilter:main Jan 27, 2026
jfilter added a commit that referenced this pull request Jan 27, 2026
- Extract _get_copy_fn() helper to eliminate duplicated copy/move/symlink
  selection in copy_files() and fixed() oversampling
- Fix valid_extensions() crash when formats=None (PR #38 bug)
- Fix isinstance check for tuple in oversampling path
- Replace os.path usage with pathlib in refactored sections
- Run ruff format on all files
@jfilter

jfilter commented Jan 27, 2026

Copy link
Copy Markdown
Owner

Merged into main — thanks @master-fury and @govindbanura! The formats parameter is now available on both ratio() and fixed(). I fixed a bug where valid_extensions() would crash when formats=None (the default), and updated list_files() to use f.suffix for cleaner extension matching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants