experimental/schoology/schoolopy/main.py
def _get(self, path):
        """
        GET data from a given endpoint.

        :param path: Path (following API root) to endpoint.
        :return: JSON response.
        """

        try:
            url = '%s%s?limit=%s&start=%s' % (self._ROOT, path, self.limit, self.start)

            if self.verbose:
                print("--> calling {}".format(url))

            response = self.schoology_auth.oauth.get(url=url, headers=self.schoology_auth._request_header(), auth=self.schoology_auth.oauth.auth)

            return response.json()
            # SFUQUA TODO: this library is not well structured for paging support.

        except JSONDecodeError as ex:
            # SFUQUA TODO: consider better error handling here, so that we know
            # what went wrong. For now, at least add verbose logging. Long-term,
            # probably want to throw dedicated exception types instead of
            # swallowing the exception.
            if self.verbose:
                print(ex)
            return {}

        GET data from a given endpoint.

        :param path: Path (following API root) to endpoint.
        :return: JSON response.
        
GET data from a given endpoint.
GET data from a given endpoint .
def _get(self, path):
        try:
            url = '%s%s?limit=%s&start=%s' % (self._ROOT, path, self.limit, self.start)
            if self.verbose:
                print("--> calling {}".format(url))
            response = self.schoology_auth.oauth.get(url=url, headers=self.schoology_auth._request_header(), auth=self.schoology_auth.oauth.auth)
            return response.json()
        except JSONDecodeError as ex:
            if self.verbose:
                print(ex)
            return {}
def _get ( self , path ) : try : url = '%s%s?limit=%s&start=%s' % ( self . _ROOT , path , self . limit , self . start ) if self . verbose : print ( "--> calling {}" . format ( url ) ) response = self . schoology_auth . oauth . get ( url = url , headers = self . schoology_auth . _request_header ( ) , auth = self . schoology_auth . oauth . auth ) return response . json ( ) except JSONDecodeError as ex : if self . verbose : print ( ex ) return { }
GET data from a given endpoint.
GET data from a given endpoint .
"""
        GET data from a given endpoint.

        :param path: Path (following API root) to endpoint.
        :return: JSON response.
        """ # SFUQUA TODO: this library is not well structured for paging support. # SFUQUA TODO: consider better error handling here, so that we know # what went wrong. For now, at least add verbose logging. Long-term, # probably want to throw dedicated exception types instead of # swallowing the exception.
None
self
path
Path (following API root) to endpoint.
Path ( following API root ) to endpoint .