Skip to main content

Notion-News-Crawler

Notion News Crawler is a Python library that collects news from Notion and uploads it to a database.

News can be collected using Naver Search API, so only Naver and Notion API keys can be used by putting them in environment variables.

Table of Contents

  1. Install
  2. Supported Python Version
  3. APIs
  4. Result

Install

$ pip3 install notion-news-crawler

Supported Python version

Library Supported Version
Notion News Crawler 3.8, 3.9, 3.10, 3.11, 3.12

Quick Start

from notion_news_crawler import NaverAPI, UploadToDataBase, ResetDatabase


if __name__=='__main__':
    reset_database = ResetDatabase()
    reset_database.delete_all_pages()

    for subject in ['Economy', 'Science', 'Society', 'Politics', 'Stock']:
        naver_api = NaverAPI(subject, 100)
        news_data = naver_api.parse_data(naver_api.get_news())

        upload_to_database = UploadToDataBase(news_data)
        upload_to_database.add_to_notion()

APIs

To use this library, Notion and Naver API are required.

Just enter the two API Key values ​​in the environment variables.

Environment parameters

You can create an environment variable .env file and use it by entering the following.

.env file format

# Notion
NOTION_TOKEN='YOUR NOTION TOKEN'
NOTION_DATABASE_ID='YOUR NOTION DATABASE ID'

# Naver
X_NAVER_CLIENT_ID='YOUR NAVER CLIENT ID'
X_NAVER_SECRET='YOUR NAVER SECRET KEY'

Notion API

The Notion API can be found at: Notion API
Enter the Notion application token value in the environment variable. Create a Notion application, register the Notion application in the database you will use, and then use it.

Naver API

You can create a Naver application and obtain the API key value.
More detail on NAVER API docs

The Naver API result values ​​are as follows, and when uploading to Notion, you can refine and use the data as you wish.

{
    "title": "article title",
    "originallink": "original news link",
    "link": "naver news link",
    "description": "article description",
    "pubDate": "published date"
}

Metadata

Release files for notion-news-crawler 0.0.9

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

Source distribution (sdist)

Source distribution for notion-news-crawler 0.0.9
File Size Uploaded
notion-news-crawler-0.0.9.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for notion-news-crawler 0.0.9
File Interpreter ABI Platform
notion_news_crawler-0.0.9-py3-none-any.whl Python 3 none any Details

Total release size: 14.8 kB

Release files / notion-news-crawler-0.0.9.tar.gz

Download URL notion-news-crawler-0.0.9.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
84daa1aa7f3d51cb477349163d2fef8a2b74a68298646856c810cfa2ca4a9470
BLAKE2b-256 checksum
How to use checksums
726049c5afc9a5f6536960f5f941a3496c21976d13e3394131543b2a9c27761c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release files / notion_news_crawler-0.0.9-py3-none-any.whl

Download URL notion_news_crawler-0.0.9-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5c5472d9a621384febd80626eba7ae4787ecbd9d73a10379c852162e60969eb7
BLAKE2b-256 checksum
How to use checksums
b440f6816c294f1fe1cf8d37fe094b6ee2b2f0dbcd9f049968225d52f23f1a80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.0.9 This release

2 release files

0.0.8

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