Event Registry Python Versions Save

Python package for API access to news articles and events in the Event Registry

9.1

10 months ago

v9.1 (2023-06-23)

Added

  • added keywordSearchMode parameter that can be used in QueryArticles, QueryArticlesIter, QueryEvents, QueryEventsIter and QueryEvent constructors.
  • added keywordSearchMode parameter to the advanced query language
  • added documentation page for keywordSearchMode and the examples of usage

Updated

  • types of parameters in the method calls
  • updated several code example files

9.0

1 year ago

v9.0 (2023-05-15)

Added

  • added use of the typing module. All parameters in the method calls use typing support to make it easier to understand what type is expected.
  • added autosuggest methods suggestEventTypes, suggestIndustries, getSdgUris, getSasbUris - all to be used only when querying mentions

Updated

  • QueryArticles class. Added filters authorsFilter, videosFilter, linksFilter
  • QueryMentions class. Added several filters: industryUri, sdgUri, sasbUri, esgUri, minSentenceIndex, maxSentenceIndex, showDuplicates
  • updated several code example files

8.10

2 years ago

v8.10 (2021-08-16)

NOTE: This is the last version with Python 2.X and Python <3.5 support. Next version will contain type hints and will only be compatible with Python 3.5 or higher.

Added

  • added file QueryMentions that can be used to query mentions of specific event types. The class is currently in beta and not available to users unless they have permissions to use this endpoint. The classes QueryMentions and QueryMentionsIter can be used in the same way as classes for querying articles and events, except that some query parameters are addded and some removed. Examples for the classes were also added.

Updated

  • When using method initWithComplexQuery we now check if the provided json is valid json object and report error in case it is not
  • some bugs that appeared in edge cases when querying Event Registry using EventRegistry class have been fixed.

8.9

3 years ago

v8.9 (2020-10-21)

Added

  • added required and excluded optional parameters to the TopicPage class to methods addConcept, addKeyword, addCategory, addSource, addSourceLocation and addSourceGroup.
  • exceptions are now raised by the SDK library in case of status codes 204, 400, 401 and 403. Previously, the requests were repeated if status code was not 200. In case of these status codes it however doesn't make sense to simply repeat the requests as the query will for sure return the same exception. The meaning of the above status codes is described on the documentation page.

8.7

4 years ago

Added

  • added EventRegistry.getServiceStatus() method that reports status of the services
  • ComplexQueryArticles and ComplexQueryEvents classes now support in the constructor additional filters like minSentiment, maxSentiment, minFacebookShares, endSourceRankPercentile, etc.

Updated

  • ReturnInfo classes (ArticleInfoFlags, ConceptInfoFlags, ...) were updated. Some obsolete parameters were removed and we have added support for kwdargs to supply some very rarely used parameters directly.
  • TopicPage.getArticles and TopicPage.getEvents methods now support also **kwargs so that you can now also provide other available parameters that are less frequently used.

Removed

  • removed EventRegistry.suggestCustomConcepts() and EventRegistry.getCustomConceptUri() methods. Not used anymore since we are not supporting anymore the correlation feature.

8.6

5 years ago

Added

  • We added sentiment, which can now be used in querying of articles and events. The QueryArticles, QueryArticlesIter, QueryEvents, QueryEventsIter constructors now all have additional parameters minSentiment and maxSentiment that can be used to filter the articles and events. The valid values are between -1 (very negative sentiment) and 1 (very positive sentiment). Value 0 represents neutral sentiment.
  • Sentiment was also added as a property in the returned articles and events.

Updated

  • Analytics: We updated trainTopicOnTweets(), trainTopicClearTopic() and trainTopicGetTrainedTopic() methods in the Analytics class.
  • Analytics.annotate() method now supports passing custom parameters that should be used when annotating the text.
  • Changed some defaults in the returned data. When searching articles, we now by default return article image and sentiment.
  • Analytics. updated trainTopicOnTweets(), trainTopicClearTopic() and trainTopicGetTrainedTopic() methods in the Analytics class.
  • QueryArticles.initWithComplexQuery() was updated - the parameter dataType was removed (since the dataType value should be provided in the $filter section of the query)
  • TopicPage now supports setting also the source rank percentile
  • Analytics.extractArticleInfo now also supports setting the headers and cookies to be used when making the requests

8.5

5 years ago

Added

  • Added Analytics.trainTopicOnTweets() method that can be used to train a topic by analyzing a group of tweets. See an example of usage on the wiki page.
  • Added a group of Analytics.trainTopic*() methods that can be used to analyze your own documents and build a topic from them. See an example of usage on the wiki page.

8.4

5 years ago

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) 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}.

8.2.0

5 years ago

Added

  • added TopicPage class. It can be used to create a topic by specifying keywords, concepts, sources, ... as well as their weights. You can specify a threshold and receive only articles and events that match enough specified conditions to reach the required weight. Alternatively, you can simply sort the results by relevance and get the top-ranked results that are most related to your topic page. See TopicPageExamples.py file for examples on how to use the topic pages.
  • added named entity extraction endpoint to Analytics. Call Analytics.ner(text) to extract named entities.

Updated

  • sentiment analysis now supports two models - vocabulary based as well as a model using neural networks. Choose the model by specifying the method parameter. Possible values for it are vocabulary (vocabulary based sentiment analysis, default) or rnn (neural networks based model).

8.1.0

5 years ago

Added

  • added blog data type. Various methods in EventRegistry class accept it, such as suggestNewsSources(), suggestSourcesAtPlace() and getNewsSourceUri().

Updated

  • QueryArticlesIter.initWithComplexQuery() now accepts also the dataType parameter (by default news).

Removed

  • Removed the parameter articleBatchSize from QueryArticlesIter.execQuery since it was not useful. We are always returning the maximum number of results that can be obtained with a single query.