@@ -94,17 +94,17 @@ with open('output.csv') as fp:
9494
9595### Streaming real-time data
9696
97- It is possible to subscribe to a real-time stream for a dataset:
97+ It is possible to subscribe to a real-time stream for a dataset.
9898
99- ``` python
100- ds = api.get_dataset(dataset_id = ' us500' )
101- for record in ds.request_realtime():
102- print (record)
103- print (record.timestamp_utc, record.entity_name,
104- record[' event_relevance' ])
105- ```
99+ Once you create a streaming connection to the real-time feed with your dataset,
100+ you will receive analytics records as soon as they are published.
101+
102+
103+ It is suggested to handle possible disconnection with a retry policy.
104+ You can find a [ real-time streaming example here] ( ravenpackapi/examples/get_realtime_news.py ) .
106105
107- The Result object takes care of converting the various fields to the appropriate type, so ` record.timestamp_utc ` will be a ` datetime `
106+ The Result object handles the conversion of various fields into the appropriate type,
107+ i.e. ` record.timestamp_utc ` will be converted to ` datetime `
108108
109109### Entity mapping
110110
@@ -157,3 +157,24 @@ for ticker in references.tickers:
157157 if ticker.is_valid():
158158 print (ticker)
159159```
160+
161+ ### Accessing the low-level requests
162+
163+ RavenPack API wrapper is using the [ requests library] ( https://2.python-requests.org ) to do HTTPS requests,
164+ you can set common requests parameters to all the outbound calls by setting the ` common_request_params ` attribute.
165+
166+ For example, to disable HTTPS certificate verification and to setup your internal proxy:
167+
168+ ``` python
169+ api = RPApi()
170+ api.common_request_params.update(
171+ dict (
172+ proxies = {' https' : ' http://your_internal_proxy:9999' },
173+ verify = False ,
174+ )
175+ )
176+
177+ # use the api to do requests
178+ ```
179+
180+ PS. For setting your internal proxies, requests will honor the HTTPS_PROXY environment variable.
0 commit comments