Skip to content

bubble-tea-project/libpttea

Repository files navigation

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

About

A Python library that encapsulates various PTT functions

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages