Skip to main content

This is a Dcard API wrapper

Project description

This is a Dcard API wrapper

Overview

Pydcard is a Python wrapper for accessing the Dcard API.

Pydcard only support in Python 3

Installation

The current release of Pydcard is available through PyPi:

pip install pydcard

Dependencies

pip does install dependencies

Usage

The basic usage

import pydcard
from pprint import pprint

# Get top posts in *all* forum from Dcard. The parameter is page number.
page_one = pydcard.get_all_top_posts(1)

# Each page have 20 threads, now get the id in index 0.
# i.e. the first thread's id.
th_one_id = page_one[0].get('id')

# Using thread id to get the post content
pprint((pydcard.get_post(th_one_id)))

The complicated example (Need to install prettytable package)

dcard\_term

dcard_term

API

  • get_post(post_id)

    Getting post content by post ID.

  • get_all_top_posts(to_page_num)

    Getting top posts from all forum. From page 1 to page to_page_num.

  • get_all_new_posts(to_page_num)

    Getting recently posts from all forum. From page 1 to page to_page_num.

  • get_all_page(page_num)

    Getting recently posts from all forum, only one page.

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

pydcard-0.0.8.tar.gz (298.0 kB view details)

Uploaded Source

File details

Details for the file pydcard-0.0.8.tar.gz.

File metadata

  • Download URL: pydcard-0.0.8.tar.gz
  • Upload date:
  • Size: 298.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pydcard-0.0.8.tar.gz
Algorithm Hash digest
SHA256 971de9cde6e63deab6b7fa0f77aea027f56f47459851201bce5c2d2d6c932199
MD5 17fcd57899b0b7761bdfd4adec9f3a4b
BLAKE2b-256 a905a718fd112c2d089607bce66c865de7b845544facf1889d6e573c687ddae0

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