Skip to content
Snippets Groups Projects
Commit 2026c146 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

added simple json service

parent 18423440
No related branches found
No related tags found
No related merge requests found
import json
from typing import Dict
from TheCodeLabs_BaseUtils.MultiCacheKeyService import MultiCacheKeyService
class JsonService(MultiCacheKeyService):
"""
Fetches information from a given json file.
"""
EXAMPLE_SETTINGS = {
"path": "path/to/my/file.json"
}
def _fetch_data(self, settings: Dict) -> Dict:
with open(settings['path'], encoding='utf-8') as f:
data = json.load(f)
return {'data': data}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment