{"action":"created","comment":{"url":"https://api.github.com/repos/datapackages/jsontableschema-py/pulls/comments/55134311","id":55134311,"diff_hunk":"@@ -208,27 +182,181 @@ schema = infer(headers, values)\n \n The number of rows used by `infer` can be limited with the `row_limit` argument.\n \n-### CLI\n+### Validate\n+\n+Given a schema as JSON file, url to JSON file, or a Python dict, `validate` returns `True` for a valid JSON Table Schema, or raises an exception, `SchemaValidationError`.\n+\n+```python\n+import io\n+import json\n+\n+from jsontableschema import validate\n+\n+filepath = 'schema_to_validate.json'\n+\n+with io.open(filepath) as stream:\n+    schema = json.load(stream)\n+\n+is_valid = jsontableschema.validate(schema)\n+print(is_valid)\n+# True\n+\n+```\n+\n+It may be useful to report multiple errors when validating a schema. This can be done with `validator.iter_errors()`.\n+\n+```python\n+\n+from jsontableschema import validator\n+\n+filepath = 'schema_with_multiple_errors.json'\n+with io.open(filepath) as stream:\n+    schema = json.load(stream)\n+    errors = [i for i in validator.iter_errors(schema)]\n+```\n+\n+Note: `validate()` validates whether a **schema** is a validate JSON Table Schema. It does **not** validate data against a schema.\n+\n+### Export/import","path":"README.md","position":160,"original_position":160,"commit_id":"8d745e6da58bcc83687abe5c7e625c6b15abfc75","original_commit_id":"8d745e6da58bcc83687abe5c7e625c6b15abfc75","user":{"login":"roll","id":557395,"avatar_url":"https://avatars.githubusercontent.com/u/557395?v=3","gravatar_id":"","url":"https://api.github.com/users/roll","html_url":"https://github.com/roll","followers_url":"https://api.github.com/users/roll/followers","following_url":"https://api.github.com/users/roll/following{/other_user}","gists_url":"https://api.github.com/users/roll/gists{/gist_id}","starred_url":"https://api.github.com/users/roll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roll/subscriptions","organizations_url":"https://api.github.com/users/roll/orgs","repos_url":"https://api.github.com/users/roll/repos","events_url":"https://api.github.com/users/roll/events{/privacy}","received_events_url":"https://api.github.com/users/roll/received_events","type":"User","site_admin":false},"body":"I'm +1 with it - I'll update a PR. \r\n\r\nAlso than `datapackage-py` should follow this logic too.","created_at":"2016-03-06T07:14:02Z","updated_at":"2016-03-06T07:14:02Z","html_url":"https://github.com/datapackages/jsontableschema-py/pull/51#discussion_r55134311","pull_request_url":"https://api.github.com/repos/datapackages/jsontableschema-py/pulls/51","_links":{"self":{"href":"https://api.github.com/repos/datapackages/jsontableschema-py/pulls/comments/55134311"},"html":{"href":"https://github.com/datapackages/jsontableschema-py/pull/51#discussion_r55134311"},"pull_request":{"href":"https://api.github.com/repos/datapackages/jsontableschema-py/pulls/51"}}},"pull_request":{"url":"https://api.github.com/repos/datapackages/jsontableschema-py/pulls/51","id":61818940,"html_url":"https://github.com/datapackages/jsontableschema-py/pull/51","diff_url":"https://github.com/datapackages/jsontableschema-py/pull/51.diff","patch_url":"https://github.com/datapackages/jsontableschema-py/pull/51.patch","issue_url":"https://api.github.com/repos/datapackages/jsontableschema-py/issues/51","number":51,"state":"open","locked":false,"title":"Feature/plugins and storage","user":{"login":"roll","id":557395,"avatar_url":"https://avatars.githubusercontent.com/u/557395?v=3","gravatar_id":"","url":"https://api.github.com/users/roll","html_url":"https://github.com/roll","followers_url":"https://api.github.com/users/roll/followers","following_url":"https://api.github.com/users/roll/following{/other_user}","gists_url":"https://api.github.com/users/roll/gists{/gist_id}","starred_url":"https://api.github.com/users/roll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roll/subscriptions","organizations_url":"https://api.github.com/users/roll/orgs","repos_url":"https://api.github.com/users/roll/repos","events_url":"https://api.github.com/users/roll/events{/privacy}","received_events_url":"https://api.github.com/users/roll/received_events","type":"User","site_admin":false},"body":"Changes:\r\n\r\n- added plugin system - https://github.com/datapackages/jsontableschema-py/issues/49\r\n- added storage interface - https://github.com/datapackages/jsontableschema-py/issues/47\r\n- added export/import resource - https://github.com/datapackages/jsontableschema-py/issues/48\r\n- fixed input schema mutation - https://github.com/datapackages/jsontableschema-py/issues/43","created_at":"2016-03-05T17:58:46Z","updated_at":"2016-03-06T07:14:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"94c1bb0c98eb37821a45ca7299bf0096f55376d7","assignee":{"login":"roll","id":557395,"avatar_url":"https://avatars.githubusercontent.com/u/557395?v=3","gravatar_id":"","url":"https://api.github.com/users/roll","html_url":"https://github.com/roll","followers_url":"https://api.github.com/users/roll/followers","following_url":"https://api.github.com/users/roll/following{/other_user}","gists_url":"https://api.github.com/users/roll/gists{/gist_id}","starred_url":"https://api.github.com/users/roll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roll/subscriptions","organizations_url":"https://api.github.com/users/roll/orgs","repos_url":"https://api.github.com/users/roll/repos","events_url":"https://api.github.com/users/roll/events{/privacy}","received_events_url":"https://api.github.com/users/roll/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/datapackages/jsontableschema-py/milestones/8","html_url":"https://github.com/datapackages/jsontableschema-py/milestones/0.6.0","labels_url":"https://api.github.com/repos/datapackages/jsontableschema-py/milestones/8/labels","id":1621874,"number":8,"title":"0.6.0","description":"","creator":{"login":"roll","id":557395,"avatar_url":"https://avatars.githubusercontent.com/u/557395?v=3","gravatar_id":"","url":"https://api.github.com/users/roll","html_url":"https://github.com/roll","followers_url":"https://api.github.com/users/roll/followers","following_url":"https://api.github.com/users/roll/following{/other_user}","gists_url":"https://api.github.com/users/roll/gists{/gist_id}","starred_url":"https://api.github.com/users/roll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roll/subscriptions","organizations_url":"https://api.github.com/users/roll/orgs","repos_url":"https://api.github.com/users/roll/repos","events_url":"https://api.github.com/users/roll/events{/privacy}","received_events_url":"https://api.github.com/users/roll/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":0,"state":"open","created_at":"2016-03-04T09:25:57Z","updated_at":"2016-03-05T17:59:05Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/datapackages/jsontableschema-py/pulls/51/commits","review_comments_url":"https://api.github.com/repos/datapackages/jsontableschema-py/pulls/51/comments","review_comment_url":"https://api.github.com/repos/datapackages/jsontableschema-py/pulls/comments{/number}","comments_url":"https://api.github.com/repos/datapackages/jsontableschema-py/issues/51/comments","statuses_url":"https://api.github.com/repos/datapackages/jsontableschema-py/statuses/8d745e6da58bcc83687abe5c7e625c6b15abfc75","head":{"label":"datapackages:feature/plugins-and-storage","ref":"feature/plugins-and-storage","sha":"8d745e6da58bcc83687abe5c7e625c6b15abfc75","user":{"login":"datapackages","id":16058553,"avatar_url":"https://avatars.githubusercontent.com/u/16058553?v=3","gravatar_id":"","url":"https://api.github.com/users/datapackages","html_url":"https://github.com/datapackages","followers_url":"https://api.github.com/users/datapackages/followers","following_url":"https://api.github.com/users/datapackages/following{/other_user}","gists_url":"https://api.github.com/users/datapackages/gists{/gist_id}","starred_url":"https://api.github.com/users/datapackages/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datapackages/subscriptions","organizations_url":"https://api.github.com/users/datapackages/orgs","repos_url":"https://api.github.com/users/datapackages/repos","events_url":"https://api.github.com/users/datapackages/events{/privacy}","received_events_url":"https://api.github.com/users/datapackages/received_events","type":"Organization","site_admin":false},"repo":{"id":30863890,"name":"jsontableschema-py","full_name":"datapackages/jsontableschema-py","owner":{"login":"datapackages","id":16058553,"avatar_url":"https://avatars.githubusercontent.com/u/16058553?v=3","gravatar_id":"","url":"https://api.github.com/users/datapackages","html_url":"https://github.com/datapackages","followers_url":"https://api.github.com/users/datapackages/followers","following_url":"https://api.github.com/users/datapackages/following{/other_user}","gists_url":"https://api.github.com/users/datapackages/gists{/gist_id}","starred_url":"https://api.github.com/users/datapackages/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datapackages/subscriptions","organizations_url":"https://api.github.com/users/datapackages/orgs","repos_url":"https://api.github.com/users/datapackages/repos","events_url":"https://api.github.com/users/datapackages/events{/privacy}","received_events_url":"https://api.github.com/users/datapackages/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/datapackages/jsontableschema-py","description":"A Python library for working with JSON Table Schema.","fork":false,"url":"https://api.github.com/repos/datapackages/jsontableschema-py","forks_url":"https://api.github.com/repos/datapackages/jsontableschema-py/forks","keys_url":"https://api.github.com/repos/datapackages/jsontableschema-py/keys{/key_id}","collaborators_url":"https://api.github.com/repos/datapackages/jsontableschema-py/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/datapackages/jsontableschema-py/teams","hooks_url":"https://api.github.com/repos/datapackages/jsontableschema-py/hooks","issue_events_url":"https://api.github.com/repos/datapackages/jsontableschema-py/issues/events{/number}","events_url":"https://api.github.com/repos/datapackages/jsontableschema-py/events","assignees_url":"https://api.github.com/repos/datapackages/jsontableschema-py/assignees{/user}","branches_url":"https://api.github.com/repos/datapackages/jsontableschema-py/branches{/branch}","tags_url":"https://api.github.com/repos/datapackages/jsontableschema-py/tags","blobs_url":"https://api.github.com/repos/datapackages/jsontableschema-py/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/datapackages/jsontableschema-py/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/datapackages/jsontableschema-py/git/refs{/sha}","trees_url":"https://api.github.com/repos/datapackages/jsontableschema-py/git/trees{/sha}","statuses_url":"https://api.github.com/repos/datapackages/jsontableschema-py/statuses/{sha}","languages_url":"https://api.github.com/repos/datapackages/jsontableschema-py/languages","stargazers_url":"https://api.github.com/repos/datapackages/jsontableschema-py/stargazers","contributors_url":"https://api.github.com/repos/datapackages/jsontableschema-py/contributors","subscribers_url":"https://api.github.com/repos/datapackages/jsontableschema-py/subscribers","subscription_url":"https://api.github.com/repos/datapackages/jsontableschema-py/subscription","commits_url":"https://api.github.com/repos/datapackages/jsontableschema-py/commits{/sha}","git_commits_url":"https://api.github.com/repos/datapackages/jsontableschema-py/git/commits{/sha}","comments_url":"https://api.github.com/repos/datapackages/jsontableschema-py/comments{/number}","issue_comment_url":"https://api.github.com/repos/datapackages/jsontableschema-py/issues/comments{/number}","contents_url":"https://api.github.com/repos/datapackages/jsontableschema-py/contents/{+path}","compare_url":"https://api.github.com/repos/datapackages/jsontableschema-py/compare/{base}...{head}","merges_url":"https://api.github.com/repos/datapackages/jsontableschema-py/merges","archive_url":"https://api.github.com/repos/datapackages/jsontableschema-py/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/datapackages/jsontableschema-py/downloads","issues_url":"https://api.github.com/repos/datapackages/jsontableschema-py/issues{/number}","pulls_url":"https://api.github.com/repos/datapackages/jsontableschema-py/pulls{/number}","milestones_url":"https://api.github.com/repos/datapackages/jsontableschema-py/milestones{/number}","notifications_url":"https://api.github.com/repos/datapackages/jsontableschema-py/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/datapackages/jsontableschema-py/labels{/name}","releases_url":"https://api.github.com/repos/datapackages/jsontableschema-py/releases{/id}","deployments_url":"https://api.github.com/repos/datapackages/jsontableschema-py/deployments","created_at":"2015-02-16T10:44:10Z","updated_at":"2016-02-08T14:21:59Z","pushed_at":"2016-03-05T20:03:41Z","git_url":"git://github.com/datapackages/jsontableschema-py.git","ssh_url":"git@github.com:datapackages/jsontableschema-py.git","clone_url":"https://github.com/datapackages/jsontableschema-py.git","svn_url":"https://github.com/datapackages/jsontableschema-py","homepage":"","size":169,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":11,"forks":5,"open_issues":11,"watchers":7,"default_branch":"master"}},"base":{"label":"datapackages:master","ref":"master","sha":"400fe9ca9e70bd5a07c5fbd71bf1bd19a51a9310","user":{"login":"datapackages","id":16058553,"avatar_url":"https://avatars.githubusercontent.com/u/16058553?v=3","gravatar_id":"","url":"https://api.github.com/users/datapackages","html_url":"https://github.com/datapackages","followers_url":"https://api.github.com/users/datapackages/followers","following_url":"https://api.github.com/users/datapackages/following{/other_user}","gists_url":"https://api.github.com/users/datapackages/gists{/gist_id}","starred_url":"https://api.github.com/users/datapackages/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datapackages/subscriptions","organizations_url":"https://api.github.com/users/datapackages/orgs","repos_url":"https://api.github.com/users/datapackages/repos","events_url":"https://api.github.com/users/datapackages/events{/privacy}","received_events_url":"https://api.github.com/users/datapackages/received_events","type":"Organization","site_admin":false},"repo":{"id":30863890,"name":"jsontableschema-py","full_name":"datapackages/jsontableschema-py","owner":{"login":"datapackages","id":16058553,"avatar_url":"https://avatars.githubusercontent.com/u/16058553?v=3","gravatar_id":"","url":"https://api.github.com/users/datapackages","html_url":"https://github.com/datapackages","followers_url":"https://api.github.com/users/datapackages/followers","following_url":"https://api.github.com/users/datapackages/following{/other_user}","gists_url":"https://api.github.com/users/datapackages/gists{/gist_id}","starred_url":"https://api.github.com/users/datapackages/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datapackages/subscriptions","organizations_url":"https://api.github.com/users/datapackages/orgs","repos_url":"https://api.github.com/users/datapackages/repos","events_url":"https://api.github.com/users/datapackages/events{/privacy}","received_events_url":"https://api.github.com/users/datapackages/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/datapackages/jsontableschema-py","description":"A Python library for working with JSON Table Schema.","fork":false,"url":"https://api.github.com/repos/datapackages/jsontableschema-py","forks_url":"https://api.github.com/repos/datapackages/jsontableschema-py/forks","keys_url":"https://api.github.com/repos/datapackages/jsontableschema-py/keys{/key_id}","collaborators_url":"https://api.github.com/repos/datapackages/jsontableschema-py/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/datapackages/jsontableschema-py/teams","hooks_url":"https://api.github.com/repos/datapackages/jsontableschema-py/hooks","issue_events_url":"https://api.github.com/repos/datapackages/jsontableschema-py/issues/events{/number}","events_url":"https://api.github.com/repos/datapackages/jsontableschema-py/events","assignees_url":"https://api.github.com/repos/datapackages/jsontableschema-py/assignees{/user}","branches_url":"https://api.github.com/repos/datapackages/jsontableschema-py/branches{/branch}","tags_url":"https://api.github.com/repos/datapackages/jsontableschema-py/tags","blobs_url":"https://api.github.com/repos/datapackages/jsontableschema-py/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/datapackages/jsontableschema-py/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/datapackages/jsontableschema-py/git/refs{/sha}","trees_url":"https://api.github.com/repos/datapackages/jsontableschema-py/git/trees{/sha}","statuses_url":"https://api.github.com/repos/datapackages/jsontableschema-py/statuses/{sha}","languages_url":"https://api.github.com/repos/datapackages/jsontableschema-py/languages","stargazers_url":"https://api.github.com/repos/datapackages/jsontableschema-py/stargazers","contributors_url":"https://api.github.com/repos/datapackages/jsontableschema-py/contributors","subscribers_url":"https://api.github.com/repos/datapackages/jsontableschema-py/subscribers","subscription_url":"https://api.github.com/repos/datapackages/jsontableschema-py/subscription","commits_url":"https://api.github.com/repos/datapackages/jsontableschema-py/commits{/sha}","git_commits_url":"https://api.github.com/repos/datapackages/jsontableschema-py/git/commits{/sha}","comments_url":"https://api.github.com/repos/datapackages/jsontableschema-py/comments{/number}","issue_comment_url":"https://api.github.com/repos/datapackages/jsontableschema-py/issues/comments{/number}","contents_url":"https://api.github.com/repos/datapackages/jsontableschema-py/contents/{+path}","compare_url":"https://api.github.com/repos/datapackages/jsontableschema-py/compare/{base}...{head}","merges_url":"https://api.github.com/repos/datapackages/jsontableschema-py/merges","archive_url":"https://api.github.com/repos/datapackages/jsontableschema-py/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/datapackages/jsontableschema-py/downloads","issues_url":"https://api.github.com/repos/datapackages/jsontableschema-py/issues{/number}","pulls_url":"https://api.github.com/repos/datapackages/jsontableschema-py/pulls{/number}","milestones_url":"https://api.github.com/repos/datapackages/jsontableschema-py/milestones{/number}","notifications_url":"https://api.github.com/repos/datapackages/jsontableschema-py/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/datapackages/jsontableschema-py/labels{/name}","releases_url":"https://api.github.com/repos/datapackages/jsontableschema-py/releases{/id}","deployments_url":"https://api.github.com/repos/datapackages/jsontableschema-py/deployments","created_at":"2015-02-16T10:44:10Z","updated_at":"2016-02-08T14:21:59Z","pushed_at":"2016-03-05T20:03:41Z","git_url":"git://github.com/datapackages/jsontableschema-py.git","ssh_url":"git@github.com:datapackages/jsontableschema-py.git","clone_url":"https://github.com/datapackages/jsontableschema-py.git","svn_url":"https://github.com/datapackages/jsontableschema-py","homepage":"","size":169,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":11,"forks":5,"open_issues":11,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/datapackages/jsontableschema-py/pulls/51"},"html":{"href":"https://github.com/datapackages/jsontableschema-py/pull/51"},"issue":{"href":"https://api.github.com/repos/datapackages/jsontableschema-py/issues/51"},"comments":{"href":"https://api.github.com/repos/datapackages/jsontableschema-py/issues/51/comments"},"review_comments":{"href":"https://api.github.com/repos/datapackages/jsontableschema-py/pulls/51/comments"},"review_comment":{"href":"https://api.github.com/repos/datapackages/jsontableschema-py/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/datapackages/jsontableschema-py/pulls/51/commits"},"statuses":{"href":"https://api.github.com/repos/datapackages/jsontableschema-py/statuses/8d745e6da58bcc83687abe5c7e625c6b15abfc75"}}}}