Skip to content

Commit def9723

Browse files
authored
Merge pull request #131 from drewrice2/master
adds "pymongo==3.5.1" to `setup.py`, README spacing
2 parents 32fdc98 + 2e7bda8 commit def9723

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,16 +240,19 @@ wsClient.close()
240240
### WebsocketClient + Mongodb
241241
The ```WebsocketClient``` now supports data gathering via MongoDB. Given a
242242
MongoDB collection, the ```WebsocketClient``` will stream results directly into
243-
the database collection.
243+
the database collection.
244244
```python
245245
# import PyMongo and connect to a local, running Mongo instance
246246
from pymongo import MongoClient
247+
import gdax
247248
mongo_client = MongoClient('mongodb://localhost:27017/')
249+
248250
# specify the database and collection
249251
db = mongo_client.cryptocurrency_database
250252
BTC_collection = db.BTC_collection
253+
251254
# instantiate a WebsocketClient instance, with a Mongo collection as a parameter
252-
wsClient = WebsocketClient(url="wss://ws-feed.gdax.com", products="BTC-USD",
255+
wsClient = gdax.WebsocketClient(url="wss://ws-feed.gdax.com", products="BTC-USD",
253256
mongo_collection=BTC_collection, should_print=False)
254257
wsClient.start()
255258
```
@@ -261,9 +264,9 @@ can react to the data streaming in. The current client is a template used for
261264
illustration purposes only.
262265

263266

264-
- onOpen - called once, *immediately before* the socket connection is made, this
267+
- onOpen - called once, *immediately before* the socket connection is made, this
265268
is where you want to add initial parameters.
266-
- onMessage - called once for every message that arrives and accepts one
269+
- onMessage - called once for every message that arrives and accepts one
267270
argument that contains the message of dict type.
268271
- onClose - called once after the websocket has been closed.
269272
- close - call this method to close the websocket connection (do not overwrite).

contributors.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ Leonard Lin
33
Jeff Gibson
44
David Caseria
55
Paul Mestemaker
6+
Drew Rice

gdax/websocket_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
from pymongo import MongoClient
1717

1818
class WebsocketClient(object):
19-
def __init__(self, url="wss://ws-feed.gdax.com", products=None, message_type="subscribe",
20-
mongo_collection=None, should_print=True, auth=False, api_key="", api_secret="", api_passphrase=""):
19+
def __init__(self, url="wss://ws-feed.gdax.com", products=None,
20+
message_type="subscribe", mongo_collection=None, should_print=True,
21+
auth=False, api_key="", api_secret="", api_passphrase=""):
2122
self.url = url
2223
self.products = products
2324
self.type = message_type

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ bintrees==2.0.7
22
requests==2.13.0
33
six==1.10.0
44
websocket-client==0.40.0
5-
pymongo
5+
pymongo==3.5.1

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
'requests==2.13.0',
88
'six==1.10.0',
99
'websocket-client==0.40.0',
10+
'pymongo==3.5.1'
1011
]
1112

1213
tests_require = [

0 commit comments

Comments
 (0)