{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-services/kinto-client/pulls/comments/32727085","id":32727085,"diff_hunk":"@@ -4,3 +4,88 @@ Kinto python client\n Python library to interact with a `Kinto <https://kinto.readthedocs.org>`_\n HTTP server.\n \n+Usage\n+=====\n+\n+.. warning::\n+    The approach this library takes is different from the one took in the\n+    `Cliquetis <https://github.com/mozilla-services/cliquetis>`_ javascript\n+    client: Operations are always performed directly on the server, and no\n+    synchronisation features are implemented yet.\n+\n+- Every operation is done remotely; No synchronisation operation is supported;\n+- \n+\n+To create a bucket and a collection (needed to use them later):\n+\n+.. code-block:: python\n+\n+    import kintoclient import Bucket\n+\n+    # First, create a bucket.\n+    bucket = Bucket(name='payments', server_url='http://localhost:8888/v1',\n+                    auth=credentials, create=True)\n+\n+    # In case it already exists, you can just retrieve it.\n+    bucket = Bucket(name='payments', server_url='http://localhost:8888/v1',\n+                    auth=credential)\n+\n+    # Handling collections\n+    collection = payments.create_collection(name='receipts')\n+    collection = payments.get_collection(name='receipts')\n+    collection.destroy() # Deletes the collection.\n+    bucket.delete_collection(name='receipts')\n+\n+    # Handling records\n+    record = collection.create_record(data={})\n+    record = collection.get_all_records()\n+    record = collection.get_record()\n+    collection.save_record(record)  # Issues a PUT or PATCH\n+    collection.delete_record(record)\n+    collection.delete_records([record1, record2])\n+\n+    # Permissions on records\n+    # Makes the record avail. to everyone.\n+    record = collection.create_record(data={}, public=True)\n+    record = collection.create_record(\n+      data={},\n+      permissions={'read': ['group:groupid']})\n+    collection.update_record_permissions(id=1234, read=['basicauth_kumar', ])","path":"README.rst","position":50,"original_position":50,"commit_id":"9aa8b2dfd155088427222a94589fa1bdd1677c46","original_commit_id":"9aa8b2dfd155088427222a94589fa1bdd1677c46","user":{"login":"Natim","id":229453,"avatar_url":"https://avatars.githubusercontent.com/u/229453?v=3","gravatar_id":"","url":"https://api.github.com/users/Natim","html_url":"https://github.com/Natim","followers_url":"https://api.github.com/users/Natim/followers","following_url":"https://api.github.com/users/Natim/following{/other_user}","gists_url":"https://api.github.com/users/Natim/gists{/gist_id}","starred_url":"https://api.github.com/users/Natim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Natim/subscriptions","organizations_url":"https://api.github.com/users/Natim/orgs","repos_url":"https://api.github.com/users/Natim/repos","events_url":"https://api.github.com/users/Natim/events{/privacy}","received_events_url":"https://api.github.com/users/Natim/received_events","type":"User","site_admin":false},"body":"```\r\nbucket = Bucket(name='payments', server_url='http://localhost:8888/v1', auth=credential)\r\ncollection = bucket.get_collection('receipts', create=True)\r\nrecord = collection.add_record(data={id='XXX', status='done', title='Todo #1'})\r\n\r\nrecords = collection.get_records()\r\nfor i, record in enumerate(records):\r\n    record.data.title = 'Todo #%d' %i\r\n\r\ncollection.save_records(records)\r\n```","created_at":"2015-06-18T13:09:01Z","updated_at":"2015-06-18T13:09:01Z","html_url":"https://github.com/mozilla-services/kinto-client/pull/1#discussion_r32727085","pull_request_url":"https://api.github.com/repos/mozilla-services/kinto-client/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/mozilla-services/kinto-client/pulls/comments/32727085"},"html":{"href":"https://github.com/mozilla-services/kinto-client/pull/1#discussion_r32727085"},"pull_request":{"href":"https://api.github.com/repos/mozilla-services/kinto-client/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-services/kinto-client/pulls/1","id":37996254,"html_url":"https://github.com/mozilla-services/kinto-client/pull/1","diff_url":"https://github.com/mozilla-services/kinto-client/pull/1.diff","patch_url":"https://github.com/mozilla-services/kinto-client/pull/1.patch","issue_url":"https://api.github.com/repos/mozilla-services/kinto-client/issues/1","number":1,"state":"open","locked":false,"title":"Add dreamcode in the readme","user":{"login":"ametaireau","id":67073,"avatar_url":"https://avatars.githubusercontent.com/u/67073?v=3","gravatar_id":"","url":"https://api.github.com/users/ametaireau","html_url":"https://github.com/ametaireau","followers_url":"https://api.github.com/users/ametaireau/followers","following_url":"https://api.github.com/users/ametaireau/following{/other_user}","gists_url":"https://api.github.com/users/ametaireau/gists{/gist_id}","starred_url":"https://api.github.com/users/ametaireau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ametaireau/subscriptions","organizations_url":"https://api.github.com/users/ametaireau/orgs","repos_url":"https://api.github.com/users/ametaireau/repos","events_url":"https://api.github.com/users/ametaireau/events{/privacy}","received_events_url":"https://api.github.com/users/ametaireau/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-18T11:25:21Z","updated_at":"2015-06-18T13:09:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ff8cc25a858a93fe3fd6a0f80e1f59d5c5b468f1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-services/kinto-client/pulls/1/commits","review_comments_url":"https://api.github.com/repos/mozilla-services/kinto-client/pulls/1/comments","review_comment_url":"https://api.github.com/repos/mozilla-services/kinto-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla-services/kinto-client/issues/1/comments","statuses_url":"https://api.github.com/repos/mozilla-services/kinto-client/statuses/9aa8b2dfd155088427222a94589fa1bdd1677c46","head":{"label":"mozilla-services:readme","ref":"readme","sha":"9aa8b2dfd155088427222a94589fa1bdd1677c46","user":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"repo":{"id":37655419,"name":"kinto-client","full_name":"mozilla-services/kinto-client","owner":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-services/kinto-client","description":"Python library to interact with Kinto","fork":false,"url":"https://api.github.com/repos/mozilla-services/kinto-client","forks_url":"https://api.github.com/repos/mozilla-services/kinto-client/forks","keys_url":"https://api.github.com/repos/mozilla-services/kinto-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-services/kinto-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-services/kinto-client/teams","hooks_url":"https://api.github.com/repos/mozilla-services/kinto-client/hooks","issue_events_url":"https://api.github.com/repos/mozilla-services/kinto-client/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-services/kinto-client/events","assignees_url":"https://api.github.com/repos/mozilla-services/kinto-client/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-services/kinto-client/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-services/kinto-client/tags","blobs_url":"https://api.github.com/repos/mozilla-services/kinto-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-services/kinto-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-services/kinto-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-services/kinto-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-services/kinto-client/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-services/kinto-client/languages","stargazers_url":"https://api.github.com/repos/mozilla-services/kinto-client/stargazers","contributors_url":"https://api.github.com/repos/mozilla-services/kinto-client/contributors","subscribers_url":"https://api.github.com/repos/mozilla-services/kinto-client/subscribers","subscription_url":"https://api.github.com/repos/mozilla-services/kinto-client/subscription","commits_url":"https://api.github.com/repos/mozilla-services/kinto-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-services/kinto-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-services/kinto-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-services/kinto-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-services/kinto-client/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-services/kinto-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-services/kinto-client/merges","archive_url":"https://api.github.com/repos/mozilla-services/kinto-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-services/kinto-client/downloads","issues_url":"https://api.github.com/repos/mozilla-services/kinto-client/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-services/kinto-client/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-services/kinto-client/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-services/kinto-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-services/kinto-client/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-services/kinto-client/releases{/id}","created_at":"2015-06-18T11:24:34Z","updated_at":"2015-06-18T11:24:34Z","pushed_at":"2015-06-18T11:25:21Z","git_url":"git://github.com/mozilla-services/kinto-client.git","ssh_url":"git@github.com:mozilla-services/kinto-client.git","clone_url":"https://github.com/mozilla-services/kinto-client.git","svn_url":"https://github.com/mozilla-services/kinto-client","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"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":"mozilla-services:master","ref":"master","sha":"700e9c8fd8880fb1f4b80c5381e0bccea5fabea9","user":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"repo":{"id":37655419,"name":"kinto-client","full_name":"mozilla-services/kinto-client","owner":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-services/kinto-client","description":"Python library to interact with Kinto","fork":false,"url":"https://api.github.com/repos/mozilla-services/kinto-client","forks_url":"https://api.github.com/repos/mozilla-services/kinto-client/forks","keys_url":"https://api.github.com/repos/mozilla-services/kinto-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-services/kinto-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-services/kinto-client/teams","hooks_url":"https://api.github.com/repos/mozilla-services/kinto-client/hooks","issue_events_url":"https://api.github.com/repos/mozilla-services/kinto-client/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-services/kinto-client/events","assignees_url":"https://api.github.com/repos/mozilla-services/kinto-client/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-services/kinto-client/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-services/kinto-client/tags","blobs_url":"https://api.github.com/repos/mozilla-services/kinto-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-services/kinto-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-services/kinto-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-services/kinto-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-services/kinto-client/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-services/kinto-client/languages","stargazers_url":"https://api.github.com/repos/mozilla-services/kinto-client/stargazers","contributors_url":"https://api.github.com/repos/mozilla-services/kinto-client/contributors","subscribers_url":"https://api.github.com/repos/mozilla-services/kinto-client/subscribers","subscription_url":"https://api.github.com/repos/mozilla-services/kinto-client/subscription","commits_url":"https://api.github.com/repos/mozilla-services/kinto-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-services/kinto-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-services/kinto-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-services/kinto-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-services/kinto-client/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-services/kinto-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-services/kinto-client/merges","archive_url":"https://api.github.com/repos/mozilla-services/kinto-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-services/kinto-client/downloads","issues_url":"https://api.github.com/repos/mozilla-services/kinto-client/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-services/kinto-client/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-services/kinto-client/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-services/kinto-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-services/kinto-client/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-services/kinto-client/releases{/id}","created_at":"2015-06-18T11:24:34Z","updated_at":"2015-06-18T11:24:34Z","pushed_at":"2015-06-18T11:25:21Z","git_url":"git://github.com/mozilla-services/kinto-client.git","ssh_url":"git@github.com:mozilla-services/kinto-client.git","clone_url":"https://github.com/mozilla-services/kinto-client.git","svn_url":"https://github.com/mozilla-services/kinto-client","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"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/mozilla-services/kinto-client/pulls/1"},"html":{"href":"https://github.com/mozilla-services/kinto-client/pull/1"},"issue":{"href":"https://api.github.com/repos/mozilla-services/kinto-client/issues/1"},"comments":{"href":"https://api.github.com/repos/mozilla-services/kinto-client/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-services/kinto-client/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-services/kinto-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla-services/kinto-client/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-services/kinto-client/statuses/9aa8b2dfd155088427222a94589fa1bdd1677c46"}}}}