Commit 060d8a0b by David Robinson

Made changes consistent between commits (REST_API_KEY), also changed README to…

Made changes consistent between commits (REST_API_KEY), also changed README to refer to parse_rest, and changed contact email to mine.
parents bf35957f 4ff5f0d4
ParsePy parse_rest
======= =======
**ParsePy** is a Python client for the [Parse REST API](https://www.parse.com/docs/rest). It provides Python object mapping for Parse objects with methods to save, update, and delete objects, as well as an interface for querying stored objects. **parse_rest** is a Python client for the [Parse REST API](https://www.parse.com/docs/rest). It provides Python object mapping for Parse objects with methods to save, update, and delete objects, as well as an interface for querying stored objects.
Basic Usage Basic Usage
----------- -----------
Let's get everything set up first. You'll need to give **ParsePy** your _Application Id_ and _Master Key_ (available from your Parse dashboard) in order to get access to your data. Let's get everything set up first. You'll need to give **parse_rest** your _Application Id_ and _REST API Key_ (available from your Parse dashboard) in order to get access to your data.
~~~~~ {python} ~~~~~ {python}
>>> import parse >>> import parse_rest
>>> parse.APPLICATION_ID = "your application id" >>> parse_rest.APPLICATION_ID = "your application id"
>>> parse.API_KEY = "your API key here" >>> parse_rest.REST_API_KEY = "your REST API key here"
~~~~~ ~~~~~
To create a new object of the Parse class _GameScore_: To create a new object of the Parse class _GameScore_:
...@@ -135,4 +135,4 @@ We can also order the results using: ...@@ -135,4 +135,4 @@ We can also order the results using:
* **Order** * **Order**
* order(_parameter_name_, _decending_=False) * order(_parameter_name_, _decending_=False)
That's it! This is a first try at a Python library for Parse, and is probably not bug-free. If you run into any issues, please get in touch -- parsepy@paulkastner.com. Thanks! That's it! This is a first try at a Python library for Parse, and is probably not bug-free. If you run into any issues, please get in touch -- dgrtwo@princeton.edu. Thanks!
...@@ -23,8 +23,7 @@ import logging ...@@ -23,8 +23,7 @@ import logging
API_ROOT = 'https://api.parse.com/1' API_ROOT = 'https://api.parse.com/1'
APPLICATION_ID = '' APPLICATION_ID = ''
API_KEY = '' REST_API_KEY = ''
MASTER_KEY = ''
class ParseBinaryDataWrapper(str): class ParseBinaryDataWrapper(str):
pass pass
...@@ -44,9 +43,11 @@ class ParseBase(object): ...@@ -44,9 +43,11 @@ class ParseBase(object):
request = urllib2.Request(url, data) request = urllib2.Request(url, data)
request.add_header('Content-type', 'application/json') request.add_header('Content-type', 'application/json')
request.add_header('X-Parse-Application-Id', APPLICATION_ID) #auth_header = "Basic %s" % base64.b64encode('%s:%s' %
request.add_header('X-Parse-REST-API-Key', API_KEY) # (APPLICATION_ID, REST_API_KEY))
for header, value in headers.items(): request.add_header(header, value) #request.add_header("Authorization", auth_header)
request.add_header("X-Parse-Application-Id", APPLICATION_ID)
request.add_header("X-Parse-REST-API-Key", REST_API_KEY)
request.get_method = lambda: http_verb request.get_method = lambda: http_verb
......
...@@ -16,7 +16,7 @@ except ImportError: ...@@ -16,7 +16,7 @@ except ImportError:
) )
parse_rest.APPLICATION_ID = settings_local.APPLICATION_ID parse_rest.APPLICATION_ID = settings_local.APPLICATION_ID
parse_rest.API_KEY = settings_local.API_KEY parse_rest.REST_API_KEY = settings_local.REST_API_KEY
### FUNCTIONS ### ### FUNCTIONS ###
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment