Skip to content

Commit 5ddc80c

Browse files
committed
update client to 0.1.3 for api v3.0
1 parent 8941d3d commit 5ddc80c

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

keen/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class KeenApi(object):
1212
# the default base URL of the Keen API
1313
base_url = "https://api.keen.io"
1414
# the default version of the Keen API
15-
api_version = "2.0"
15+
api_version = "3.0"
1616

1717
def __init__(self, project_id, auth_token, base_url=None,
1818
api_version=None):
@@ -38,7 +38,7 @@ def post_event(self, event):
3838
3939
:param event: an Event to upload
4040
"""
41-
url = "{}/{}/projects/{}/{}".format(self.base_url, self.api_version,
41+
url = "{}/{}/projects/{}/events/{}".format(self.base_url, self.api_version,
4242
self.project_id,
4343
event.collection_name)
4444
headers = {"Authorization": self.auth_token,

keen/client.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import copy
12
import json
23
from keen import persistence_strategies, exceptions
34
from keen.api import KeenApi
@@ -31,11 +32,9 @@ def to_json(self):
3132
3233
:returns: a string
3334
"""
34-
event_as_dict = {
35-
"body": self.event_body
36-
}
35+
event_as_dict = copy.deepcopy(self.event_body)
3736
if self.timestamp:
38-
event_as_dict["header"] = {"timestamp": self.timestamp.isoformat()}
37+
event_as_dict["keen"] = {"timestamp": self.timestamp.isoformat()}
3938
return json.dumps(event_as_dict)
4039

4140

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from distutils.core import setup
44

55
setup(name="keen",
6-
version="0.1.2",
6+
version="0.1.3",
77
description="Python Client for Keen.io",
88
author="Keen Labs",
99
author_email="[email protected]",

0 commit comments

Comments
 (0)