uninews
a universal news feed api for all news provider
Installation
pip install uninews
Supported providers
Usage
Using thenewsapi provider
from uninews import NewsFeed
from TheNewsApi import set_app_info
set_app_info(appkey=mykey)
nf = NewsFeet('TheNewsApp')
x = nf.last_news()
print(x)
x = nf.hist_news()
print(x)
x = nf.sources()
print(x)
Features
NewsFeed provide four type news get methods: last_news: get last news from the specified provider
hist_news: get history news from the specified provider
sources: get the provider's sources of news
if the provider do not provide the method, it will return None
Return data structure
News data
The news data return by last_news() and hist_news() methods are the same, t is a dictionary data which contains:
- total total record returned
- articles a array contain all the articles
Article data
article is a dict contains following keys:
- title the article's title
- description the summary description
- content the article body
- link the url address to the article
- img_link the article image url address
- video_link the video url address of article
- publish_date the article publish date
- countries countries of the article
- categories categories of the article
- author article's author
- source_id source id of the article
- language article's language
sources data
- total
- sources
source data
- id
- name
- link
- language
- categories
- description
- countries
provider
the following provider is tested
- newsdataio for https://newsdata.io
- news_yapi for newsapi
- thenewsapi for thenewsapi
working on provider
- google feed news provider
Metadata
Release files for uninews 0.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| uninews-0.0.9.tar.gz | 4.3 kB | Without provenance | Details for uninews-0.0.9.tar.gz |
Release files / uninews-0.0.9.tar.gz
| Download URL | uninews-0.0.9.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
613261bdeb996a2de2415fb5237d71eb477c643601f0f8603ff40555aa5f1e8c
|
|
BLAKE2b-256 checksum How to use checksums |
e87320c34f25e38d3cda93fe272643706e3a8e99711cf908bfcf6238e0239fca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.25.0 requests-toolbelt/0.9.1 urllib3/1.26.2 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.9.13
|
Security for uninews 0.0.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.