
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
An asyncio Python library to perform request against News API. It provides direct access to the endpoints defined in the documentation.
Two classes are implemented, returning async iterators for the request results. Session will return an iterator through the results of a single request. Alternatively, Stream will return an infinite iterator, performing successive requests and continuing to iterate through the results. A minimal implementation can be as simple as:
import asyncio
from asyncnewsapi import Session
async def main():
async with Session() as api:
async for article in api.top_headlines(language='en'):
print(article['title'])
if __name__ == '__main__':
asyncio.run(main())
The API key should be provided as an environment variable named NEWSAPI_KEY:
export NEWSAPI_KEY="..."
Go to the NewsAPI website to create a free API key.
This library is loosely based on / inspired by newsapi-python, a requests based library by Matt Lisivick.
Use pip to install this package, either directly from pypi:
pip install asyncnewsapi
or after cloning from github:
pip install .
Unit tests have been implemented using pytest. To run them, additional dependencies need be installed:
pip install ".[test]"
The tests can then be run using:
python -m pytest -v tests/
from the root of the repo (running it explicitly on the tests/ directory avoids interference with the venv folders).
FAQs
AsyncIO Python wrapper to News API
We found that asyncnewsapi demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.