A Python library that encapsulates various PTT functions.
Project description
LibPttea
📖 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
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.0.0.tar.gz
(17.6 kB
view details)
Built Distribution
libpttea-1.0.0-py3-none-any.whl
(21.6 kB
view details)
File details
Details for the file libpttea-1.0.0.tar.gz
.
File metadata
- Download URL: libpttea-1.0.0.tar.gz
- Upload date:
- Size: 17.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b90c56326fc1f027d86bbc93784d388e67875ceacbb87b8a5827a610256126f5 |
|
MD5 | 151fbcc466a09e72d5addd364ba84aa2 |
|
BLAKE2b-256 | 195ae39ad6f56990911f160f0f930fb5c8f64442a5316b78d98070fb8e1a0a70 |
File details
Details for the file libpttea-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: libpttea-1.0.0-py3-none-any.whl
- Upload date:
- Size: 21.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5e033d883543ab18d00029d5d79017bfe75013d8abb7ebc3f96b51d009bb6b0 |
|
MD5 | ec83667e5fc32bce23b9470b2b4cd865 |
|
BLAKE2b-256 | aa6cfdd0ba00ab0a4abd1b4fbcd6b4f91aa46a73be4394e3edf12aab9bc3ea7b |