Skip to content

ItsRqtl/cbmc.py

Repository files navigation

cbmc.py

Coverage CodeFactor GitHub issues GitHub pull requests

PyPI PyPI - License PyPI - Downloads

Unofficial 麥塊匿名發文平台 API Wrapper for Python

Installation

pip install cbmc.py

Usage

# Import the library
from cbmc import AsyncCbmc, SyncCbmc

api = SyncCbmc()

# Obtain post with post id, raise cbmc.NotFound if not found
api.get_post(1)

# List recent posts, maximum 300 posts.
api.get_posts()

# Directly call the method also works
# Creating an instance is not required, but it is recommended for future updates.
# (some planned new features will require that)
SyncCbmc.get_post(1)

# Also available in async
async def main():
    await AsyncCbmc.get_post(1)
    await AsyncCbmc.get_posts()

Documentation

Credits

License

This project is licensed under MIT License. See the LICENSE for more details.