Skip to main content

A Python library that encapsulates various PTT functions.

Project description

LibPttea

A Python library that encapsulates various PTT functions.

PyPI - Stable Version PyPI - Python Version GitHub Actions Workflow Status GitHub License

📖 Description

LibPttea 是一個 Python library,目的在封裝各種 PTT 功能操作,旨在輔助開發 PTTea APP 專案的 PTT 功能函式庫。

✨ Supported

  • login
  • logout
  • get_system_info
  • get_favorite_list
  • get_post_list
  • get_post
  • 🔨 in development...

📦 Installation

LibPttea is available on PyPI:

python -m pip install libpttea

Or you can use Poetry:

poetry add libpttea

🎨 Usage

import asyncio
import libpttea

PTT_ACCOUNT = "PTT ID"
PTT_PASSWORD = "PTT 密碼"

async def main():

    lib_pttea = await libpttea.login(PTT_ACCOUNT,PTT_PASSWORD)

    system_info = await lib_pttea.get_system_info()
    print(system_info)
    # ['您現在位於 批踢踢實業坊 (140.112.172.11)', 
    # '系統負載: 輕輕鬆鬆', 
    # '線上人數: 27492/175000', 
    # 'ClientCode: 02000023', 
    # '起始時間: 10/20/2024 05:15:40', 
    # '編譯時間: Sun Jun  4 23:41:30 CST 2023', 
    # '編譯版本: https://github.com/ptt/pttbbs.git 0447b25c 8595c8b4 M']
    
    await lib_pttea.logout()

# run the coroutine 
asyncio.run(main())

🔗 Links

📜 License

GitHub License

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

libpttea-1.1.0.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

libpttea-1.1.0-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

Details for the file libpttea-1.1.0.tar.gz.

File metadata

  • Download URL: libpttea-1.1.0.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for libpttea-1.1.0.tar.gz
Algorithm Hash digest
SHA256 8347f1d5f1263c1e77d0148c7c0d25b17ac840b26fe5c9e921ddd83c6055a93e
MD5 3b97a76db89ba325278047d3773ed0e9
BLAKE2b-256 f69c91266a714134e3d60fd8b21ad6aed7e623b1b959c700761f789c70b525f6

See more details on using hashes here.

File details

Details for the file libpttea-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: libpttea-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for libpttea-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 728070035109ed1a99edc0b35011ae82c6a5d6d798a1cc475d0b6391b3e9f710
MD5 f8985c3a7d61a9cea325e351f27c9ca8
BLAKE2b-256 24fdf1bcb335aff78cdacecb6108c53be3101ac01cc12be76d78cb1610df648e

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