Skip to content

Instantly share code, notes, and snippets.

@jathanism
Created November 19, 2014 18:28
Show Gist options
  • Select an option

  • Save jathanism/0d625b55428fdad2f341 to your computer and use it in GitHub Desktop.

Select an option

Save jathanism/0d625b55428fdad2f341 to your computer and use it in GitHub Desktop.
from trigger.netdevices.loaders.filesystem import JSONLoader
import requests
class JSONApiLoader(JSONLoader):
"""
Wrapper for loading metadata via JSON from the filesystem.
Parse 'netdevices.json' and return list of JSON objects.
"""
is_usable = True
def get_data(self, data_source):
# This is a simple example that has no error-checking.
data = requests.get(data_source)
return data.json()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment