You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Added**
- added `EventRegistry.getUsageInfo()` method, which returns the number of used tokens and the total number of available tokens for the given user. The existing methods `EventRegisty.getRemainingAvailableRequests()` and `EventRegistry.getDailyAvailableRequests()` are still there, but their value is only valid after making at least one request.
- added searching of articles and events based on article authors. You can now provide `authorUri` parameter when creating the `QueryArticles` and `QueryEvents` instances.
- added author related methods to `EventRegistry` class: `EventRegistry.suggestAuthors()` to obtain uris of authors for given (partial) name and `EventRegistry.getAuthorUri()` to obtain a single author uri for the given (partial) name.
- added ability to search articles and events by authors. `QueryArticles` and `QueryEvents` constructors now also accept `authorUri` parameter that can be used to limit the results to articles/events by those authors. Use `QueryOper.AND()` or `QueryOper.OR()` to specify multiple authors in the same query.
- BETA: added a filter for returning only articles that are written by sources that have a certain ranking. The filter can be specified by setting the parameters `startSourceRankPercentile` and `endSourceRankPercentile` when creating the `QueryArticles` instance. The default value for `startSourceRankPercentile` is 0 and for `endSourceRankPercentile` is 100. The values that can be set are not any value between 0 and 100 but has to be a number divisible by 10. By setting `startSourceRankPercentile` to 0 and `endSourceRankPercentile` to 20 you would get only articles from top ranked news sources (according to [Alexa site ranking](https://www.alexa.com/siteinfo)) that would amount to about *approximately 20%* of all matching content. Note: 20 percentiles do not represent 20% of all top sources. The value is used to identify the subset of news sources that generate approximately 20% of our collected news content. The reason for this choice is that top ranked 10% of news sources writes about 30% of all news content and our choice normalizes this effect. This feature could potentially change in the future.
- `QueryEventArticlesIter` is now able to return only a subset of articles assigned to an event. You can use the same filters as with the `QueryArticles` constructor and you can specify them when constructing the instance of `QueryEventArticlesIter`. The same kind of filtering is also possible if you want to use the `RequestEventArticles()` class instead.
- added some parameters and changed default values in some of the result types to reflect the backend changes.
- added optional parameter `proxyUrl` to `Analytics.extractArticleInfo()`. It can be used to download article info through a proxy that you provide (to avoid potential GDPR issues). The `proxyUrl` should be in format `{schema}://{username}:{pass}@{proxy url/ip}`.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,17 @@
1
1
# Change Log
2
2
3
+
## [v8.4]() (2018-08-24)
4
+
5
+
**Added**
6
+
- added `EventRegistry.getUsageInfo()` method, which returns the number of used tokens and the total number of available tokens for the given user. The existing methods `EventRegisty.getRemainingAvailableRequests()` and `EventRegistry.getDailyAvailableRequests()` are still there, but their value is only valid after making at least one request.
7
+
- added searching of articles and events based on article authors. You can now provide `authorUri` parameter when creating the `QueryArticles` and `QueryEvents` instances.
8
+
- added author related methods to `EventRegistry` class: `EventRegistry.suggestAuthors()` to obtain uris of authors for given (partial) name and `EventRegistry.getAuthorUri()` to obtain a single author uri for the given (partial) name.
9
+
- added ability to search articles and events by authors. `QueryArticles` and `QueryEvents` constructors now also accept `authorUri` parameter that can be used to limit the results to articles/events by those authors. Use `QueryOper.AND()` or `QueryOper.OR()` to specify multiple authors in the same query.
10
+
- BETA: added a filter for returning only articles that are written by sources that have a certain ranking. The filter can be specified by setting the parameters `startSourceRankPercentile` and `endSourceRankPercentile` when creating the `QueryArticles` instance. The default value for `startSourceRankPercentile` is 0 and for `endSourceRankPercentile` is 100. The values that can be set are not any value between 0 and 100 but has to be a number divisible by 10. By setting `startSourceRankPercentile` to 0 and `endSourceRankPercentile` to 20 you would get only articles from top ranked news sources (according to [Alexa site ranking](https://www.alexa.com/siteinfo)) that would amount to about *approximately 20%* of all matching content. Note: 20 percentiles do not represent 20% of all top sources. The value is used to identify the subset of news sources that generate approximately 20% of our collected news content. The reason for this choice is that top ranked 10% of news sources writes about 30% of all news content and our choice normalizes this effect. This feature could potentially change in the future.
11
+
-`QueryEventArticlesIter` is now able to return only a subset of articles assigned to an event. You can use the same filters as with the `QueryArticles` constructor and you can specify them when constructing the instance of `QueryEventArticlesIter`. The same kind of filtering is also possible if you want to use the `RequestEventArticles()` class instead.
12
+
- added some parameters and changed default values in some of the result types to reflect the backend changes.
13
+
- added optional parameter `proxyUrl` to `Analytics.extractArticleInfo()`. It can be used to download article info through a proxy that you provide (to avoid potential GDPR issues). The `proxyUrl` should be in format `{schema}://{username}:{pass}@{proxy url/ip}`.
alternative (shorter) name for the method getNewsSourceUri()
577
+
"""
578
+
returnself.getNewsSourceUri(sourceName, dataType)
579
+
580
+
555
581
defgetSourceGroupUri(self, sourceGroupName):
556
582
"""
557
583
return the URI of the source group that best matches the name
@@ -600,6 +626,18 @@ def getCustomConceptUri(self, label, lang = "eng"):
600
626
returnNone
601
627
602
628
629
+
defgetAuthorUri(self, authorName):
630
+
"""
631
+
return author uri that that is the best match for the given author name (and potentially source url)
632
+
if there are multiple matches for the given author name, they are sorted based on the number of articles they have written (from most to least frequent)
633
+
@param authorName: partial or full name of the author, potentially also containing the source url (e.g. "george brown nytimes")
Copy file name to clipboardExpand all lines: eventregistry/Query.py
+11-7Lines changed: 11 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -33,22 +33,24 @@ def __init__(self,
33
33
dateEnd=None,
34
34
dateMention=None,
35
35
sourceLocationUri=None,
36
-
sourceGroupUri=None,
36
+
sourceGroupUri=None,
37
+
authorUri=None,
37
38
keywordLoc="body",
38
39
minMaxArticlesInEvent=None,
39
40
exclude=None):
40
41
"""
41
-
@param keyword: keyword(s) to query. Either None, string or QueryItems
42
-
@param conceptUri: concept(s) to query. Either None, string or QueryItems
43
-
@param sourceUri: source(s) to query. Either None, string or QueryItems
44
-
@param locationUri: location(s) to query. Either None, string or QueryItems
45
-
@param categoryUri: categories to query. Either None, string or QueryItems
46
-
@param lang: language(s) to query. Either None, string or QueryItems
42
+
@param keyword: keyword(s) to query. Either None, string or QueryItems instance
43
+
@param conceptUri: concept(s) to query. Either None, string or QueryItems instance
44
+
@param sourceUri: source(s) to query. Either None, string or QueryItems instance
45
+
@param locationUri: location(s) to query. Either None, string or QueryItems instance
46
+
@param categoryUri: categories to query. Either None, string or QueryItems instance
47
+
@param lang: language(s) to query. Either None, string or QueryItems instance
47
48
@param dateStart: starting date. Either None, string or date or datetime
48
49
@param dateEnd: ending date. Either None, string or date or datetime
49
50
@param dateMention: search by mentioned dates - Either None, string or date or datetime or a list of these types
50
51
@param sourceLocationUri: find content generated by news sources at the specified geographic location - can be a city URI or a country URI. Multiple items can be provided using a list
51
52
@param sourceGroupUri: a single or multiple source group URIs. A source group is a group of news sources, commonly defined based on common topic or importance
53
+
@param authorUri: author(s) to query. Either None, string or QueryItems instance
52
54
@param keywordLoc: where should we look when searching using the keywords provided by "keyword" parameter. "body" (default), "title", or "body,title"
53
55
@param minMaxArticlesInEvent: a tuple containing the minimum and maximum number of articles that should be in the resulting events. Parameter relevant only if querying events
54
56
@param exclude: a instance of BaseQuery, CombinedQuery or None. Used to filter out results matching the other criteria specified in this query
0 commit comments