Skip to main content

🇰🇷 Naver Cafe Archive Module

Project description

Naver Cafe Archive

🇰🇷 Naver Cafe Archive Module

License: MIT

NaverCafeArchive

from spdlqj import NaverCafeArchive

app: NaverCafeArchive = NaverCafeArchive(cafe_id=10050146)  # 중고나라

Parameters

  • cafe_id: Union[str, int]
    • The target cafe ID to archive

Properties

  • NaverCafeArchive.sort_by
  • NaverCafeArchive.download

Methods

  • get_article_list()
  • get_menu_list()
  • get_article_content()
  • search_articles()
  • download_article_list_csv()
  • download_menu_list_csv()
  • download_search_article_list_csv()

NaverCafeArchive.sort_by

Properties

  • app.sort_by.NEWEST: str

    • The newest sort option for NaverCafeArchive.search_articles() result
  • app.sort_by.SIMILARITY: str

    • The similarity sort option for NaverCafeArchive.search_articles() result

NaverCafeArchive.download

Methods

  • app.article_list(menu_id: Union[str, int]) -> str

    • The path of article list csv file.
    • Path Rule: {current_path}/articles/{cafe_id}/{menu_id}
  • app.menu_list() -> str

    • The path of menu list csv file.
    • Path Rule: {current_path}/menus/{menus}
  • app.search_article_list(query: str) -> str

    • The path of search list csv file.
    • Path Rule: {current_path}/search/{cafe_id}/{query}
  • app.make_directory(callback_path: str) -> None

    • Create a directory with 'callback_path' received as a parameter.

NaverCafeArchive.get_article_list()

The method of extract articles.

Parameters

  • cafe_menu_id: Union[str, int]

    • Cafe menu ID to extract articles
  • per_page (default: 50): int

    • Number of articles per page
  • page (default: 1): int

The number of articles extracted is calculated by the formula per_page*page

Return Value

  • Optional[Generator]
    • article_id: The article id.
    • article_title: The article title.
    • article_writer: The writer of the article.
    • article_is_open: The permission of target cafe members to open the article.
    • article_view: The views of the article.
    • article_like: The like count of the article.
    • article_comment: The comment count of the article.
    • article_datetime: The datetime that the article was published.

NaverCafeArchive.get_menu_list()

The method of extract menu list.

Return Value

  • Optional[Generator]
    • menu_name: The menu title.
    • menu_type: The type of the menu.
    • menu_id: The menu id.
    • is_menu_updated: The state to determine if this menu has been updated.

NaverCafeArchive.get_article_content()

The method of extract article content.

Parameters

  • article_id: Union[str, int]
    • Cafe menu ID to extract articles

Return Value

  • Optional[dict]
    • article_menu_id: The article id.
    • article_title: The article title.
    • article_writer_nickname: The writer nickname of the article.
    • article_writer_id: The writer id of the article.
    • article_view: The views of the article.
    • article_datetime: The datetime that the article was published.
    • article_content_html: The html of the article.

NaverCafeArchive.search_articles()

The method of extract articles based on query results.

Parameters

  • query: str
  • sort_by: str (based NaverCafeArchive.sort_by)
  • result_count: int

Return Value

  • Optional[Generator]
    • article_id: The article id.
    • article_title: The article title.
    • article_writer_nickname: The writer nickname of the article.
    • article_writer_key: The writer UUID of the article.
    • article_view: The views of the article.
    • article_like: The like count of the article.
    • article_comment: The comment count of the article.
    • article_datetime: The datetime that the article was published.

NaverCafeArchive.download_article_list_csv()

The method of download csv file based on NaverCafeArchive.get_article_list().

Parameters

  • cafe_menu_id: Union[str, int]

    • Cafe menu ID to extract articles
  • per_page (default: 50): int

    • Number of articles per page
  • page (default: 1): int

Return Value

  • None, but the csv file is saved to the specified path. (refer NaverCafeArchive.download.search_article_list)

NaverCafeArchive.download_menu_list_csv()

The method of download csv file based on NaverCafeArchive.get_menu_list().

Return Value

  • None, but the csv file is saved to the specified path. (refer NaverCafeArchive.download.menu_list())

NaverCafeArchive.download_search_article_list_csv()

The method of download csv file based on NaverCafeArchive.search_articles().

Parameters

  • query: str
  • sort_by: str (based NaverCafeArchive.sort_by)
  • result_count: int

Return Value

  • None, but the csv file is saved to the specified path. (refer NaverCafeArchive.download.search_article_list)

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

spdlqj-0.1.1.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

spdlqj-0.1.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file spdlqj-0.1.1.tar.gz.

File metadata

  • Download URL: spdlqj-0.1.1.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.13

File hashes

Hashes for spdlqj-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f3e29147b58a47671b7c6b99860b12cedbfe5d5ff66a7848031d4a38653a5742
MD5 419fcf5d6119b647e4575a91bc0da687
BLAKE2b-256 64cd702ccd941d15d99704558b54b26f7fdc19930a9988d678c68ddf2b876df9

See more details on using hashes here.

File details

Details for the file spdlqj-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: spdlqj-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.13

File hashes

Hashes for spdlqj-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 133117cf35bc12047daa624f21bd2068ee9b58ad384c96114b557041264a488c
MD5 49fd7d941335e2b08b5954d4048ab56f
BLAKE2b-256 918be36d54ade9476ce36723eae59892ccc5576a977d3bc3907b87d2afe7697a

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