util.files should support pathlib objects
See original GitHub issueDescription
Title says it all: now that #896 is implemented, we can support pathlib natively.
Steps/Code to Reproduce
import librosa
librosa.util.find_files(pathlib.Path('foo', 'bar')) # search in foo/bar
ought to work. Right now it fails.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
pathlib — Object-oriented filesystem paths — Python 3.11.1 ...
Source code: Lib/pathlib.py This module offers classes representing filesystem paths with semantics appropriate for different operating systems.
Read more >How To Use the pathlib Module to Manipulate Filesystem ...
The Path constructor intelligently handles both types of objects and cleanly joins them using the appropriate operating system separator, in ...
Read more >Five Most Useful Pathlib Operations | by Jenny Lee - Medium
4. Get the full path of a file or directory. The .resolve() method will return a new path object with the absolute path...
Read more >Python Path – How to Use the Pathlib Module with Examples
Here, Pure path class objects will help you get the path working on your machine with some basic operations like creating child paths...
Read more >read_* functions should support pathlib objects #6657 - GitHub
Describe the problem This currently throws an error: import pathlib import mne data_dir = pathlib.Path('/Users/hoechenberger/Projects/TaLa/' ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It turns out that this just works out of the box, and no changes are necessary. Closing this one out.
@SuperKogito cool, thanks for volunteering!
Essentially, yes, it gives you a list of audio files in the given path. There are several options though (extensions, subdirectory search, case-sensitivity, etc), so it’s a bit more complex than one might expect at a first glance. Hopefully the documentation explains things thoroughly enough, but feel free to ask for clarification on the expected behavior.