mediacloud / mediacloud-news-client

An internal client library to access the new Mediacloud news archive search.
Apache License 2.0
0 stars 1 forks source link

Mediacloud News Archive Client

šŸš§ Archived šŸš§

The functionality of this package has been folded entierly into mediacloud/mc-providers. As development here will stop, the package is archived

A simple client library to access the Wayback Machine news archive search.

Installation

NB: TBD pip install mediacloud-news-client

Basic Usage

Counting matching stories:

from mcnews.searchapi import SearchApiClient
import datetime as dt

api = SearchApiClient("mediacloud_search_text_*")
api.count("coronavirus", dt.datetime(2023, 11, 1), dt.datetime(2023, 12, 1))

Paging over all matching results:

from mcnews.searchapi import SearchApiClient
import datetime as dt

api = SearchApiClient("mediacloud_search_text_*")
for page in api.all_articles("coronavirus", dt.datetime(2023, 11, 1), dt.datetime(2023, 12, 1)):
    do_something(page)

Dev Installation

Install the dependencies for dev: pip install -e .[dev]

Distribution

  1. Run pytest to make sure all the test pass
  2. Update the version number in mcnews/__init__.py
  3. Make a brief note in the version history section below about the changes
  4. Commit the changes
  5. Tag the commit with a semantic version number - 'v..*'
  6. Push to repo to GitHub
  7. Run python setup.py sdist to create an installation package
  8. Run twine upload --repository-url https://test.pypi.org/legacy/ dist/* to upload it to PyPI's test platform
  9. Run twine upload dist/* to upload it to PyPI

Version History