Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

newseyevent

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

newseyevent

A simple Python package to build event based requests for the NewsEye API

  • 0.1.0.dev202101111736
  • PyPI
  • Socket score

Maintainers
1

newseyevent

This Python package is used to represent a wikivents Event object as a Solr or platform.newseye.eu query string. Full documentation is hosted on Gitlab Pages and available publicly.

Request managers

The only object you should use in order to export event is either the SolrCollection and the SolrQueryEventArticlesInLanguage class or inherited classes.

Below is an example on how to use the SolrRequestManager:

from wikivents.models import ISO6391LanguageCode
from wikivents.factories.wikimedia import WikimediaFactory
from datetime import datetime
from newseyevent.solr import SolrQueryEventArticlesInLanguage, SolrQueryEventArticlesInLanguageDateRange, \
    SolrInstance, SolrCollection

# Create the Easter Rising event instance
event = WikimediaFactory.create_event("Q193689")

# Create the object representing the Solr Collection (on a specific host, with an explicit collection name)
solr_collection = SolrCollection(SolrInstance("localhost", 8993), "newseye_collection")

# Query articles related to the event, in English
query_articles_in_lang = SolrQueryEventArticlesInLanguage(event, ISO6391LanguageCode("fr"))
print(solr_collection.query(query_articles_in_lang))

# Query articles related to the event, in English, published between 01/01/1910 and 01/01/1911
query_articles_in_lang_date_range = SolrQueryEventArticlesInLanguageDateRange(
    event, ISO6391LanguageCode("en"),
    datetime.strptime("1910-01-01", "%Y-%m-%d"),
    datetime.strptime("1911-01-01", "%Y-%m-%d")
)
print(solr_collection.query(query_articles_in_lang_date_range))

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc