12 lines
310 B
Python
12 lines
310 B
Python
from importlib.resources import files as PackageFiles
|
|
from pathlib import Path
|
|
|
|
|
|
def get_resource(path: str) -> Path:
|
|
return Path(str(PackageFiles('barkshark_social'))).joinpath(path)
|
|
|
|
|
|
def read_resource_text(path: str) -> str:
|
|
with get_resource(path).open("r", encoding = "utf-8") as fd:
|
|
return fd.read()
|