Skip to main content

poaurk

A lightweight Python client library for the Plurk API with OAuth 1.0a authentication and real-time Comet support.

Features

  • Full OAuth 1.0a authentication flow for Plurk API
  • Command-line and customizable user interaction for OAuth verification
  • Real-time updates and notifications via Comet long-polling
  • Asyncio and aiohttp based for asynchronous HTTP requests
  • Example scripts to help you get started quickly

Requirements

  • Python 3.8+
  • aiohttp
  • oauthlib

Installation

Install the package via pip:

pip install poaurk

Usage

OAuth Authentication

import asyncio
from aiohttp import ClientSession
from poaurk.oauth import OAuthCred, PlurkOAuth

async def main():
    async with ClientSession() as session:
        cred = OAuthCred(
            customer_key="YOUR_CONSUMER_KEY",
            customer_secret="YOUR_CONSUMER_SECRET"
        )
        client = PlurkOAuth(cred, session)
        await client.authorize()
        # Now you can use client to make authenticated API requests

asyncio.run(main())

Real-time Updates with Comet

import asyncio
from aiohttp import ClientSession
from poaurk.comet import PlurkComet, OAuthCred

async def comet_example():
    async with ClientSession() as session:
        cred = OAuthCred(
            customer_key="YOUR_CONSUMER_KEY",
            customer_secret="YOUR_CONSUMER_SECRET",
            token="YOUR_ACCESS_TOKEN",
            token_secret="YOUR_ACCESS_TOKEN_SECRET"
        )
        comet = PlurkComet(cred, session)
        async for update in comet.connect():
            print("Received update:", update)

asyncio.run(comet_example())

Examples

See the examples/ directory for example scripts, including basic authentication.

Running the Basic Authentication Example

  1. Set environment variables for POAURK_TEST_KEY and POAURK_TEST_SECRET.
  2. Run the example script:
python examples/basic_auth.py

Contributing

Contributions are welcome! Please open issues or submit pull requests on GitHub.

License

This project is licensed under the terms of the MIT License. See the LICENSE file for details.

Metadata

Release files for poaurk 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for poaurk 0.6.0
File Size Uploaded
poaurk-0.6.0.tar.gz 527.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for poaurk 0.6.0
File Interpreter ABI Platform
poaurk-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 536.4 kB

Release files / poaurk-0.6.0.tar.gz

Download URL poaurk-0.6.0.tar.gz
Size 527.1 kB
Tags Source
SHA-256 checksum
How to use checksums
efb42c8943329a242d6a0ac9679e8f7d7f612744905c965088a4c5b7093bc7ac
BLAKE2b-256 checksum
How to use checksums
f7dd68fd7d452a9abba3b09648dcf5108b21a2c7f223fa227490c7c9c92f7439
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.23

Release files / poaurk-0.6.0-py3-none-any.whl

Download URL poaurk-0.6.0-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
31d2bf1c6a4314791b36b1c6af62f4aaed1ebe57fce82c545c49b3bf3cd6b216
BLAKE2b-256 checksum
How to use checksums
b76f8aa414138027006bcdc5d9fc6e677952f9911d76d76349ac1bd1514ecccc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.23

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.1.3

1 release file

0.1.2

2 release files

0.1.1

2 release files

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page