vocalpy / crowsetta

A tool to work with any format for annotating animal sounds
https://crowsetta.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
50 stars 3 forks source link

ENH: unpack example data files locally #184

Closed NickleDave closed 2 years ago

NickleDave commented 2 years ago

Added example annotation files in a crowsetta.data package in #90 but because of the way importlib.resources works, when a user calls crowsetta.data.get('format-name') it returns a context manager -- this is required since packages may be installed as a compressed file, e.g. a zip, and so there's no real path on the file system to a file that's still compressed inside that .zip.

The downside of this is that it can give the impression that a user always has to use a context manager.
It also makes all of the examples in the docstrings very verbose.

Here's a different approach:

I think I can copy some code from pooch to do this -- they have a notion of "default download location"

NickleDave commented 2 years ago