Skip to content

Commit 343be87

Browse files
author
Todd Bodnar
committed
modified docs
1 parent 9955314 commit 343be87

File tree

1 file changed

+38
-12
lines changed

1 file changed

+38
-12
lines changed

README.rst

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ will result in a dictionary of timely information for the location the ip addres
9898
.. code:: python
9999
100100
#wrap the result in json.dumps() for readability
101-
print(json.dumps(result,indent=4))
101+
print(json.dumps(result, indent = 4))
102102
103-
Which will print something similar to:
103+
Which will print:
104104

105105
.. raw:: html
106106

@@ -123,36 +123,62 @@ For example, you could get yesterday's weather in San Francisco by running:
123123
124124
brein = Breinify(apiKey)
125125
126-
yesterday = math.floor(time.time()) - 24*60*60
126+
yesterday = math.floor(time.time()) - 24 * 60 * 60
127127
128-
result = brein.temporal_data(location_free_text="San Francisco, CA", unixtime = yesterday)
128+
result = brein.temporal_data(location_free_text = "San Francisco, CA", unixtime = yesterday)
129129
130130
print("Yesterday in %s, the weather was %s with a temperature of %d F."%
131131
(result['location']['city'],
132132
result['weather']['description'],
133133
result['weather']['temperatureF']))
134134
135-
Which will print something similar to:
135+
Which will output:
136+
137+
Yesterday in **San Francisco**, the weather was **overcast clouds** with a temperature of **64** F.
138+
139+
Reverse Geocoding
140+
+++++++++++++++++
141+
142+
We support looking up locations based on latitude and longitude and provide both information about the location and relevant shape files. For example
136143

137144
.. code::
138145
139-
Yesterday in San Francisco, the weather was overcast clouds with a temperature of 64 F.
146+
florida = brein.temporal_data(location_longitude=lon, location_latitude=lat, location_shapes = ["CITY","STATE"])
147+
148+
will return both
149+
150+
.. raw:: html
151+
152+
<p align="center"><img src="https://raw.githubusercontent.com/Breinify/brein-api-library-python/master/documentation/img/sample_location.png" alt="A sample json response" width="250"></p>
153+
" alt="Breinify API Python Library" width="250"></p>
154+
155+
and
156+
157+
.. raw:: html
158+
159+
<p align="center"><img src="https://raw.githubusercontent.com/Breinify/brein-api-library-python/master/documentation/img/florida.png" alt="A map of Florida" width="250"></p>
160+
" alt="Breinify API Python Library" width="350"></p>
161+
162+
163+
* The full code for this example is available `here`__
164+
165+
.. __: https://github.com/Breinify/brein-api-library-python/blob/master/documentation/additional/point2shape.py
140166

141167

142168
Placing activity triggers
143169
^^^^^^^^^^^^^^^^^^^^^^^^^
144170

145-
The engine powering the DigitalDNA API provides three endpoints. The first endpoint is used to inform the engine about the activities performed by visitors of your site. The activities are used to understand the user's current interest and infer the intent. It becomes more and more accurate across different users and verticals as more activities are collected. It should be noted, that any personal information is not stored within the engine, thus each individual's privacy is well protected. The engine understands several different activities performed by a user, e.g., landing, login, search, item selection, or logout.
171+
The API provides support for analytics based on user behavior on your site or app by sending user activities to the `/activity` endpoint. Since the `/activity` endpoint only consumes data, calls to it in the Python library are sent asynchronously.
146172

147-
For this example, pretend that a user named "John Doe" is logged in to your site with his email address (john.doe@email.com) is viewing the page "www.example.com". You can log this by executing:
173+
For this example, pretend that a user named "John Doe" is logged in to your site with his email address (``john.doe@email.com``) is viewing the page "www.example.com". You can log this by executing:
148174

149175
.. code:: python
150176
151177
from breinify import User
152178
#create a user you are interested in with their email and last name
153-
example_user = User(email="john.doe@email.com")
179+
example_user = User(email = "john.doe@email.com")
154180
155-
brein.send_activity(example_user, "pageView", url="www.example.com")
181+
brein.send_activity(example_user, "pageView", url = "www.example.com")
156182
157183
The call will then be run asynchronously in the background.
158184

@@ -162,10 +188,10 @@ Further links
162188

163189
To understand all the capabilities of Breinify's DigitalDNA API, take a look at:
164190

165-
* `Additional Code Examples`__.
191+
* `Additional Code Samples`__
166192

167193
.. __: https://github.com/Breinify/brein-api-library-python/tree/master/documentation/additional
168194

169-
* `Breinify's Website`__.
195+
* `Breinify's Website`__
170196

171197
.. __: https://www.breinify.com

0 commit comments

Comments
 (0)