class_docstr: Stream a collection of Wikinews pages from a version- and language-specific
  database dump, either as texts or text + metadata pairs.
  
  Download a database dump (one time only!) and save its contents to disk::
  
      >>> import textacy.datasets
      >>> ds = textacy.datasets.Wikinews(lang="en", version="current")
      >>> ds.download()
      >>> ds.info
      {'name': 'wikinews',
       'site_url': 'https://en.wikinews.org/wiki/Main_Page',
       'description': 'All pages for a given language- and version-specific Wikinews site snapshot.'}
  
  Iterate over wiki pages as texts or records with both text and metadata::
  
      >>> for text in ds.texts(limit=5):
      ...     print(text[:500])
      >>> for text, meta in ds.records(limit=5):
      ...     print(meta["page_id"], meta["title"])
  
  Filter wiki pages by a variety of metadata fields and text length::
  
      >>> for text, meta in ds.records(category="Politics and conflicts", limit=5):
      ...     print(meta["title"], meta["categories"])
      >>> for text, meta in ds.records(wiki_link="Reuters", limit=5):
      ...     print(meta["title"], meta["wiki_links"])
      >>> for text in ds.texts(min_len=5000, limit=5):
      ...     print(len(text))
  
  Stream wiki pages into a :class:`textacy.Corpus <textacy.corpus.Corpus>`::
  
      >>> textacy.Corpus("en", data=ds.records(limit=100))
      Corpus(100 docs; 33092 tokens)
  
  Args:
      data_dir: Path to directory on disk under which database dump files are stored.
          Each file is expected as
          ``{lang}{project}/{version}/{lang}{project}-{version}-cirrussearch-content.json.gz``
          immediately under this directory.
      lang: Standard two-letter language code, e.g. "en" => "English", "de" => "German".
          https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
      version: Database dump version to use. Either "current" for the most recently
          available version or a date formatted as "YYYYMMDD".
          Dumps are produced weekly; check for available versions at
          https://dumps.wikimedia.org/other/cirrussearch/.
      namespace: Namespace of the wiki pages to include. Typical, public-
          facing content is in the 0 (default) namespace.
code: def __init__(
      self,
      data_dir: types.PathLike = constants.DEFAULT_DATA_DIR.joinpath(
          "wikinews"
      ),
      lang: str = "en",
      version: str = "current",
      namespace: int = 0,
  ):
      super().__init__(
          "wikinews",
          METAS["wikinews"],
          "wikinews",
          data_dir,
          lang=lang,
          version=version,
          namespace=namespace,
      )
  
imports: from __future__ import annotations
  import datetime
  import itertools
  import logging
  import os
  import re
  import urllib.parse
  from typing import Iterable, Optional
  import requests
  from cytoolz import itertoolz
  from ..None import constants
  from ..None import io
  from ..None import types, utils
  from .base import Dataset
label_desc: Use image node_id 1 to create a new Wikinews object from inherited base classes: Wikimedia with example: obj = Wikinews(data_dir, lang, version, namespace)