Created
November 19, 2014 18:28
-
-
Save jathanism/0d625b55428fdad2f341 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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