Closed NickleDave closed 2 years ago
importlib.resources.path
works only on 3.10 but says it was deprecated in 3.11 :frowning_face:
I think I need to do https://docs.python.org/3.11/library/importlib.resources.html#importlib.resources.as_file which will require re-writing everything with context managers unfortunately. But this is a constraint of getting a "path" to something that's inside a .zip
See example here: https://importlib-resources.readthedocs.io/en/latest/using.html#file-system-or-zip-file
from importlib_resources import files, as_file
source = files(email.tests.data).joinpath('message.eml')
with as_file(source) as eml:
third_party_api_requiring_file_system_path(eml)
Hoping I can do the as_file(source)
part inside the get
function and then return that context manager for someone to use?
crowsetta.data
sub-package with example annotation files andcrowsetta.data.get
function that returns paths to them, fix fixes #90