Skip to main content

Mediacloud News Archive Client

🚧 under construction 🚧

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")
api.count("coronavirus", dt.datetime(2022, 3, 1), dt.datetime(2022, 4, 1))

Paging over all matching results:

from mcnews.searchapi import SearchApiClient
import datetime as dt

api = SearchApiClient("mediacloud")
for page in api.all_articles("coronavirus", dt.datetime(2022, 3, 1), dt.datetime(2022, 4, 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

  • v2.0.0 - Fresh start as mediacloud-news-client
  • v1.2.1 - fix paging bug triggered by no results
  • v1.2.0 - add support for new expanded results, and more integration testing
  • v1.1.0 - add new paged_articles method to allow paging over all results
  • v1.0.3 - add 30 sec timeout, remove extra params mcproviders library might be adding
  • v1.0.2 - fix to article endpoint
  • v1.0.1 - automatically escape '/' in query strings, test case for url field search
  • v1.0.0 - update to public API endpoint
  • v0.1.5 - simpler return for top terms
  • v0.1.4 - better error handling
  • v0.1.3 - allow overriding base api URL
  • v0.1.2 - fix article endpoint, test case for fetching content (snippet) via article_url property
  • v0.1.1 - more consistent method names
  • v0.1.0 - initial test-only release

Metadata

Release files for mediacloud-news-client 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mediacloud-news-client 2.0.0
File Size Uploaded
mediacloud-news-client-2.0.0.tar.gz 8.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mediacloud-news-client 2.0.0
File Interpreter ABI Platform
mediacloud_news_client-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.3 kB

Release files / mediacloud-news-client-2.0.0.tar.gz

Download URL mediacloud-news-client-2.0.0.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9b33e610c2e834a4b2181f64d6fd0a9952e8ac35d77ad02edd3ba3c02f7cbfcf
BLAKE2b-256 checksum
How to use checksums
be783b2e4062bccf3f4f76417091b2e1f85a5cd58156562cc51c5e0c52257543
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / mediacloud_news_client-2.0.0-py3-none-any.whl

Download URL mediacloud_news_client-2.0.0-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d6aebac00f96a973c22cadcaf9941a453b0288540744f7bde2e5219f7e31fa5b
BLAKE2b-256 checksum
How to use checksums
e98af153f118b4fb88fdc51cc0e92637e8bf83f7d3f09dbbaf5fdf4c29aab31d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page