Easily query articles
Project description
NewsDataScrapper
Python package that helps you easily get news data
Requirements
- Python 3.5+
- Newspaper3k
- Api Key from NewsApi
Usage
from newsdatascraper import Scraper
#To first get the articles
new_scraper = Scraper('mock-api-key')
articles = new_scraper.fetch_all_articles(query='two-sigma')
#To access individual articles and their properties
first_article = articles.articles[0]
print(first_article.content)
#We also provide helper functions to serialize the data
articles.toCsv('test.csv')
articles.toPickle('test.pickle')
articles.toJson()
Working on the Project
Run format
black .
Run Linter
pylama -o setup.cfg .
Run tests
pytest
Run tests + code coverage
sh ./scripts/generate_coverage.sh
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for newsdatascraper-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aeeaf5f85e6da83ac657c434477f5c2d2ba1dcb803e537640b93d84392fb67c1 |
|
MD5 | 484b23ed340b10aa39bb0fa4e50c0392 |
|
BLAKE2b-256 | 0ec82f09644ca0b643f135f09ea83a4a0940ecb2db303145fb9e10e09b3b28ec |