{"action":"created","comment":{"url":"https://api.github.com/repos/lizardsystem/lizard-connector/pulls/comments/62035932","id":62035932,"diff_hunk":"@@ -208,18 +213,90 @@ def paginated(self):\n         return bool(self.next_url)\n \n \n-class Timeseries(Endpoint):\n-    endpoint = 'timeseries'\n-\n-\n-class Rasters(Endpoint):\n-    endpoint = 'rasters'\n-\n-\n-class Events(Endpoint):\n-    endpoint = 'events'\n+class Datatype(object):\n+    \"\"\"\n+    Experimental class that forms the building block for data types.\n \n+    Each data type contains a list of queries for each relevant lizard-api\n+    endpoint. These are the only viable queries for each endpoint.\n+    \"\"\"\n \n-# TODO:\n-# class Assets(Endpoint):\n-#     endpoint = ''\n+    @property\n+    def queries(self):\n+        \"\"\"\n+        This property needs to be implemented for the class to function.\n+        \"\"\"\n+        raise NotImplementedError\n+\n+    def list_endpoints(self):\n+        \"\"\"Lists all available endpoints for this datatype.\"\"\"\n+        return list(self.queries.keys())\n+\n+    def download(self, endpoint, *querydicts, **queries):\n+        \"\"\"Downloads a json as a dict from an endpoint.\"\"\"\n+        endpoint_ = Endpoint(endpoint)\n+        return endpoint_.download(*querydicts, **queries)\n+\n+\n+class Timeseries(Datatype):\n+    queries = {\n+        \"timeseries\": {\n+            \"in_bbox\": functools.partial(","path":"lizard_connector/connector.py","position":169,"original_position":154,"commit_id":"0336c7ccee599572a7d4fe7d3a7f8b5b1dddeef9","original_commit_id":"10f48b66e03d311e922b3a397174609b0d547965","user":{"login":"RoelvandenBerg","id":10162961,"avatar_url":"https://avatars.githubusercontent.com/u/10162961?v=3","gravatar_id":"","url":"https://api.github.com/users/RoelvandenBerg","html_url":"https://github.com/RoelvandenBerg","followers_url":"https://api.github.com/users/RoelvandenBerg/followers","following_url":"https://api.github.com/users/RoelvandenBerg/following{/other_user}","gists_url":"https://api.github.com/users/RoelvandenBerg/gists{/gist_id}","starred_url":"https://api.github.com/users/RoelvandenBerg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoelvandenBerg/subscriptions","organizations_url":"https://api.github.com/users/RoelvandenBerg/orgs","repos_url":"https://api.github.com/users/RoelvandenBerg/repos","events_url":"https://api.github.com/users/RoelvandenBerg/events{/privacy}","received_events_url":"https://api.github.com/users/RoelvandenBerg/received_events","type":"User","site_admin":false},"body":"Het werkt zoals het nu erin staat. Heb een enkele test toegevoegd op Timeseries. ","created_at":"2016-05-04T13:15:05Z","updated_at":"2016-05-04T13:15:05Z","html_url":"https://github.com/lizardsystem/lizard-connector/pull/3#discussion_r62035932","pull_request_url":"https://api.github.com/repos/lizardsystem/lizard-connector/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/lizardsystem/lizard-connector/pulls/comments/62035932"},"html":{"href":"https://github.com/lizardsystem/lizard-connector/pull/3#discussion_r62035932"},"pull_request":{"href":"https://api.github.com/repos/lizardsystem/lizard-connector/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/lizardsystem/lizard-connector/pulls/3","id":68831411,"html_url":"https://github.com/lizardsystem/lizard-connector/pull/3","diff_url":"https://github.com/lizardsystem/lizard-connector/pull/3.diff","patch_url":"https://github.com/lizardsystem/lizard-connector/pull/3.patch","issue_url":"https://api.github.com/repos/lizardsystem/lizard-connector/issues/3","number":3,"state":"open","locked":false,"title":"Adds datatype classes.","user":{"login":"RoelvandenBerg","id":10162961,"avatar_url":"https://avatars.githubusercontent.com/u/10162961?v=3","gravatar_id":"","url":"https://api.github.com/users/RoelvandenBerg","html_url":"https://github.com/RoelvandenBerg","followers_url":"https://api.github.com/users/RoelvandenBerg/followers","following_url":"https://api.github.com/users/RoelvandenBerg/following{/other_user}","gists_url":"https://api.github.com/users/RoelvandenBerg/gists{/gist_id}","starred_url":"https://api.github.com/users/RoelvandenBerg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoelvandenBerg/subscriptions","organizations_url":"https://api.github.com/users/RoelvandenBerg/orgs","repos_url":"https://api.github.com/users/RoelvandenBerg/repos","events_url":"https://api.github.com/users/RoelvandenBerg/events{/privacy}","received_events_url":"https://api.github.com/users/RoelvandenBerg/received_events","type":"User","site_admin":false},"body":"Datatypes are an experimental classes that form the building block for data types found in the Lizard backend (timeseries, rasters, assets, events).\r\nEach data type contains a list of queries for each relevant lizard-api endpoint. These are the only viable queries (of those available in lizard_connector.queries) for each endpoint.\r\nAdds relevant tests.","created_at":"2016-05-04T09:16:02Z","updated_at":"2016-05-04T13:15:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f8d5d814bbdeabefa46898dfdfd4f97c56ec88ba","assignee":{"login":"reinout","id":121433,"avatar_url":"https://avatars.githubusercontent.com/u/121433?v=3","gravatar_id":"","url":"https://api.github.com/users/reinout","html_url":"https://github.com/reinout","followers_url":"https://api.github.com/users/reinout/followers","following_url":"https://api.github.com/users/reinout/following{/other_user}","gists_url":"https://api.github.com/users/reinout/gists{/gist_id}","starred_url":"https://api.github.com/users/reinout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reinout/subscriptions","organizations_url":"https://api.github.com/users/reinout/orgs","repos_url":"https://api.github.com/users/reinout/repos","events_url":"https://api.github.com/users/reinout/events{/privacy}","received_events_url":"https://api.github.com/users/reinout/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/lizardsystem/lizard-connector/pulls/3/commits","review_comments_url":"https://api.github.com/repos/lizardsystem/lizard-connector/pulls/3/comments","review_comment_url":"https://api.github.com/repos/lizardsystem/lizard-connector/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lizardsystem/lizard-connector/issues/3/comments","statuses_url":"https://api.github.com/repos/lizardsystem/lizard-connector/statuses/0336c7ccee599572a7d4fe7d3a7f8b5b1dddeef9","head":{"label":"lizardsystem:roel-add_datatypes","ref":"roel-add_datatypes","sha":"0336c7ccee599572a7d4fe7d3a7f8b5b1dddeef9","user":{"login":"lizardsystem","id":1029862,"avatar_url":"https://avatars.githubusercontent.com/u/1029862?v=3","gravatar_id":"","url":"https://api.github.com/users/lizardsystem","html_url":"https://github.com/lizardsystem","followers_url":"https://api.github.com/users/lizardsystem/followers","following_url":"https://api.github.com/users/lizardsystem/following{/other_user}","gists_url":"https://api.github.com/users/lizardsystem/gists{/gist_id}","starred_url":"https://api.github.com/users/lizardsystem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lizardsystem/subscriptions","organizations_url":"https://api.github.com/users/lizardsystem/orgs","repos_url":"https://api.github.com/users/lizardsystem/repos","events_url":"https://api.github.com/users/lizardsystem/events{/privacy}","received_events_url":"https://api.github.com/users/lizardsystem/received_events","type":"Organization","site_admin":false},"repo":{"id":51760712,"name":"lizard-connector","full_name":"lizardsystem/lizard-connector","owner":{"login":"lizardsystem","id":1029862,"avatar_url":"https://avatars.githubusercontent.com/u/1029862?v=3","gravatar_id":"","url":"https://api.github.com/users/lizardsystem","html_url":"https://github.com/lizardsystem","followers_url":"https://api.github.com/users/lizardsystem/followers","following_url":"https://api.github.com/users/lizardsystem/following{/other_user}","gists_url":"https://api.github.com/users/lizardsystem/gists{/gist_id}","starred_url":"https://api.github.com/users/lizardsystem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lizardsystem/subscriptions","organizations_url":"https://api.github.com/users/lizardsystem/orgs","repos_url":"https://api.github.com/users/lizardsystem/repos","events_url":"https://api.github.com/users/lizardsystem/events{/privacy}","received_events_url":"https://api.github.com/users/lizardsystem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lizardsystem/lizard-connector","description":"A connector to connect to the Lizard-API (https://demo.lizard.net/api/v2/) with Python.","fork":false,"url":"https://api.github.com/repos/lizardsystem/lizard-connector","forks_url":"https://api.github.com/repos/lizardsystem/lizard-connector/forks","keys_url":"https://api.github.com/repos/lizardsystem/lizard-connector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lizardsystem/lizard-connector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lizardsystem/lizard-connector/teams","hooks_url":"https://api.github.com/repos/lizardsystem/lizard-connector/hooks","issue_events_url":"https://api.github.com/repos/lizardsystem/lizard-connector/issues/events{/number}","events_url":"https://api.github.com/repos/lizardsystem/lizard-connector/events","assignees_url":"https://api.github.com/repos/lizardsystem/lizard-connector/assignees{/user}","branches_url":"https://api.github.com/repos/lizardsystem/lizard-connector/branches{/branch}","tags_url":"https://api.github.com/repos/lizardsystem/lizard-connector/tags","blobs_url":"https://api.github.com/repos/lizardsystem/lizard-connector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lizardsystem/lizard-connector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lizardsystem/lizard-connector/git/refs{/sha}","trees_url":"https://api.github.com/repos/lizardsystem/lizard-connector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lizardsystem/lizard-connector/statuses/{sha}","languages_url":"https://api.github.com/repos/lizardsystem/lizard-connector/languages","stargazers_url":"https://api.github.com/repos/lizardsystem/lizard-connector/stargazers","contributors_url":"https://api.github.com/repos/lizardsystem/lizard-connector/contributors","subscribers_url":"https://api.github.com/repos/lizardsystem/lizard-connector/subscribers","subscription_url":"https://api.github.com/repos/lizardsystem/lizard-connector/subscription","commits_url":"https://api.github.com/repos/lizardsystem/lizard-connector/commits{/sha}","git_commits_url":"https://api.github.com/repos/lizardsystem/lizard-connector/git/commits{/sha}","comments_url":"https://api.github.com/repos/lizardsystem/lizard-connector/comments{/number}","issue_comment_url":"https://api.github.com/repos/lizardsystem/lizard-connector/issues/comments{/number}","contents_url":"https://api.github.com/repos/lizardsystem/lizard-connector/contents/{+path}","compare_url":"https://api.github.com/repos/lizardsystem/lizard-connector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lizardsystem/lizard-connector/merges","archive_url":"https://api.github.com/repos/lizardsystem/lizard-connector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lizardsystem/lizard-connector/downloads","issues_url":"https://api.github.com/repos/lizardsystem/lizard-connector/issues{/number}","pulls_url":"https://api.github.com/repos/lizardsystem/lizard-connector/pulls{/number}","milestones_url":"https://api.github.com/repos/lizardsystem/lizard-connector/milestones{/number}","notifications_url":"https://api.github.com/repos/lizardsystem/lizard-connector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lizardsystem/lizard-connector/labels{/name}","releases_url":"https://api.github.com/repos/lizardsystem/lizard-connector/releases{/id}","deployments_url":"https://api.github.com/repos/lizardsystem/lizard-connector/deployments","created_at":"2016-02-15T14:24:51Z","updated_at":"2016-02-15T14:27:52Z","pushed_at":"2016-05-04T10:58:52Z","git_url":"git://github.com/lizardsystem/lizard-connector.git","ssh_url":"git@github.com:lizardsystem/lizard-connector.git","clone_url":"https://github.com/lizardsystem/lizard-connector.git","svn_url":"https://github.com/lizardsystem/lizard-connector","homepage":null,"size":40,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"lizardsystem:master","ref":"master","sha":"c727cf410de5aa19049764cddf2533760820129e","user":{"login":"lizardsystem","id":1029862,"avatar_url":"https://avatars.githubusercontent.com/u/1029862?v=3","gravatar_id":"","url":"https://api.github.com/users/lizardsystem","html_url":"https://github.com/lizardsystem","followers_url":"https://api.github.com/users/lizardsystem/followers","following_url":"https://api.github.com/users/lizardsystem/following{/other_user}","gists_url":"https://api.github.com/users/lizardsystem/gists{/gist_id}","starred_url":"https://api.github.com/users/lizardsystem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lizardsystem/subscriptions","organizations_url":"https://api.github.com/users/lizardsystem/orgs","repos_url":"https://api.github.com/users/lizardsystem/repos","events_url":"https://api.github.com/users/lizardsystem/events{/privacy}","received_events_url":"https://api.github.com/users/lizardsystem/received_events","type":"Organization","site_admin":false},"repo":{"id":51760712,"name":"lizard-connector","full_name":"lizardsystem/lizard-connector","owner":{"login":"lizardsystem","id":1029862,"avatar_url":"https://avatars.githubusercontent.com/u/1029862?v=3","gravatar_id":"","url":"https://api.github.com/users/lizardsystem","html_url":"https://github.com/lizardsystem","followers_url":"https://api.github.com/users/lizardsystem/followers","following_url":"https://api.github.com/users/lizardsystem/following{/other_user}","gists_url":"https://api.github.com/users/lizardsystem/gists{/gist_id}","starred_url":"https://api.github.com/users/lizardsystem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lizardsystem/subscriptions","organizations_url":"https://api.github.com/users/lizardsystem/orgs","repos_url":"https://api.github.com/users/lizardsystem/repos","events_url":"https://api.github.com/users/lizardsystem/events{/privacy}","received_events_url":"https://api.github.com/users/lizardsystem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lizardsystem/lizard-connector","description":"A connector to connect to the Lizard-API (https://demo.lizard.net/api/v2/) with Python.","fork":false,"url":"https://api.github.com/repos/lizardsystem/lizard-connector","forks_url":"https://api.github.com/repos/lizardsystem/lizard-connector/forks","keys_url":"https://api.github.com/repos/lizardsystem/lizard-connector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lizardsystem/lizard-connector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lizardsystem/lizard-connector/teams","hooks_url":"https://api.github.com/repos/lizardsystem/lizard-connector/hooks","issue_events_url":"https://api.github.com/repos/lizardsystem/lizard-connector/issues/events{/number}","events_url":"https://api.github.com/repos/lizardsystem/lizard-connector/events","assignees_url":"https://api.github.com/repos/lizardsystem/lizard-connector/assignees{/user}","branches_url":"https://api.github.com/repos/lizardsystem/lizard-connector/branches{/branch}","tags_url":"https://api.github.com/repos/lizardsystem/lizard-connector/tags","blobs_url":"https://api.github.com/repos/lizardsystem/lizard-connector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lizardsystem/lizard-connector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lizardsystem/lizard-connector/git/refs{/sha}","trees_url":"https://api.github.com/repos/lizardsystem/lizard-connector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lizardsystem/lizard-connector/statuses/{sha}","languages_url":"https://api.github.com/repos/lizardsystem/lizard-connector/languages","stargazers_url":"https://api.github.com/repos/lizardsystem/lizard-connector/stargazers","contributors_url":"https://api.github.com/repos/lizardsystem/lizard-connector/contributors","subscribers_url":"https://api.github.com/repos/lizardsystem/lizard-connector/subscribers","subscription_url":"https://api.github.com/repos/lizardsystem/lizard-connector/subscription","commits_url":"https://api.github.com/repos/lizardsystem/lizard-connector/commits{/sha}","git_commits_url":"https://api.github.com/repos/lizardsystem/lizard-connector/git/commits{/sha}","comments_url":"https://api.github.com/repos/lizardsystem/lizard-connector/comments{/number}","issue_comment_url":"https://api.github.com/repos/lizardsystem/lizard-connector/issues/comments{/number}","contents_url":"https://api.github.com/repos/lizardsystem/lizard-connector/contents/{+path}","compare_url":"https://api.github.com/repos/lizardsystem/lizard-connector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lizardsystem/lizard-connector/merges","archive_url":"https://api.github.com/repos/lizardsystem/lizard-connector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lizardsystem/lizard-connector/downloads","issues_url":"https://api.github.com/repos/lizardsystem/lizard-connector/issues{/number}","pulls_url":"https://api.github.com/repos/lizardsystem/lizard-connector/pulls{/number}","milestones_url":"https://api.github.com/repos/lizardsystem/lizard-connector/milestones{/number}","notifications_url":"https://api.github.com/repos/lizardsystem/lizard-connector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lizardsystem/lizard-connector/labels{/name}","releases_url":"https://api.github.com/repos/lizardsystem/lizard-connector/releases{/id}","deployments_url":"https://api.github.com/repos/lizardsystem/lizard-connector/deployments","created_at":"2016-02-15T14:24:51Z","updated_at":"2016-02-15T14:27:52Z","pushed_at":"2016-05-04T10:58:52Z","git_url":"git://github.com/lizardsystem/lizard-connector.git","ssh_url":"git@github.com:lizardsystem/lizard-connector.git","clone_url":"https://github.com/lizardsystem/lizard-connector.git","svn_url":"https://github.com/lizardsystem/lizard-connector","homepage":null,"size":40,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lizardsystem/lizard-connector/pulls/3"},"html":{"href":"https://github.com/lizardsystem/lizard-connector/pull/3"},"issue":{"href":"https://api.github.com/repos/lizardsystem/lizard-connector/issues/3"},"comments":{"href":"https://api.github.com/repos/lizardsystem/lizard-connector/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/lizardsystem/lizard-connector/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/lizardsystem/lizard-connector/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lizardsystem/lizard-connector/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/lizardsystem/lizard-connector/statuses/0336c7ccee599572a7d4fe7d3a7f8b5b1dddeef9"}}}}