Skip to main content

Custom news scrapper

Project description

PyPI version Code style: black Maintainability

Essential

This package is a simple gatherer of different news from various APIs.

Currently, it sends all news gathered through e-mails to all the mail addresses from a database.

To send a simple mail to a target without using any database, use the function prepare_mail from mail.

Currently the gathered news are the following:

The package can be installed through the official pypi repository with:

pip install smlep-news

Architecture

This project is divided in different packages:

  • exchangerates: fetches currency exchange rates from exchangeratesapi.io/.
  • figaro: fetches french news from Le Figaro.
  • github: fetches trending repos from GitHub.
  • guardian: fetches us news from Guardian.
  • hackernews: fetches top stories list and stories details from Hacker News.
  • mail: calls gatherer from the other packages, format their content and send mail.
  • medium: extracts top stories from a specific Medium topic.
  • nytimes: fetches news from the New York Times
  • product_hunt: fetches top products from Product Hunt.
  • runner: gathers e-mail addresses from a database and send the gathered news through e-mails. This package configuration is relative to my own setup, if you want to use this program, you should bring changes to this package (or not use it).
  • weather: fetches weather from Open Weather Map. To choose the city you have to provide an ID, a list of city IDs can be downloaded here.

Credentials

This program uses APIs from different sources, and some of them require authentication. You'll have to provide API Keys in environment variables:

  • PH_CLIENT_ID/PH_CLIENT_SECRET: Product Hunt Api Client Id/Client Secret.
  • WEATHER_KEY: Open Weather Map Api Key.
  • GUARDIAN_KEY: Guardian Api Key.
  • NYT_KEY: New york times Api key

All these keys can be obtained freely on their respective websites.

To send mails, you need an email account, the default configuration is for gmail, if you need to use another mail server, you should update the code. If you use gmail, you only need to provide some environment variables:

  • EMAIL_NAME
  • EMAIL_USERNAME
  • EMAIL_PASSWORD

Why and how I created this project

I wrote a small post about this project on my GitHub Page, you can read it here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smlep_news-0.3.1.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

smlep_news-0.3.1-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file smlep_news-0.3.1.tar.gz.

File metadata

  • Download URL: smlep_news-0.3.1.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for smlep_news-0.3.1.tar.gz
Algorithm Hash digest
SHA256 ea2b4393e229144d456e6abc00324c92136eaa0d611153a0cb8ab934a61da5bd
MD5 29020277fe5d37e2cb1393a047341c08
BLAKE2b-256 bb5d4dea050b773601dea715cc4dfe5ba6caf3719ce025cf51dab0a9e975cd64

See more details on using hashes here.

File details

Details for the file smlep_news-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: smlep_news-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for smlep_news-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b78705da80a1432b47463e5ffed6beb44cb13859ec7df66dd2d0e1b434385a8c
MD5 fa0386afb36f5688ef4e0825eaa802b3
BLAKE2b-256 e62b6de97decc1ff20b4add9180bab8e70ee2b54fa179f59e40bfa346cae810f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page