ogu-api
An async Python wrapper for the OGUsers forum.
Wraps the public-facing pages and forms; login, profile lookup, reputation, credits, private messages, feed, threads, notifications, member search, account control panel, with a typed, async-first client.
Full documentation: https://ogu-api.readthedocs.io.
Install
pip install ogu-api
Requires Python 3.11+.
Quick start
import asyncio
from ogu_api import OGUClient
async def main() -> None:
async with OGUClient() as client:
await client.session.login('username', 'password')
user = await client.users.get_by_username('forgivenforget')
print(user.username, user.credits, user.reputation, user.vouches)
asyncio.run(main())
Resources
| Resource | What it covers |
|---|---|
client.session |
login page, login, logout |
client.users |
profile lookup by username or uid; returns UserProfile (id, username, reputation, vouches, credits) |
client.usercp |
notepad, signature, options, profile, change username/password/email |
client.reputation |
reputation page, send reputation |
client.credits |
donate page, stats page, send credits, parse recently-sent transactions |
client.messages |
PM inbox, conversation, compose, send, tracking, delete |
client.notifications |
notifications page, alerts, mark alerts read |
client.feed |
explore feed, home feed, thread-id extraction |
client.threads |
view thread, view forum, reply, create thread |
client.search |
full-text search form + post |
client.members |
member list, top, statistics, team, groups, vouches, awards, reputation history |
Inbox & PMs
inbox = await client.messages.inbox()
for m in inbox.messages:
print(m.username, m.message)
await client.messages.send(to = 'recipient', message = 'hello')
Inbox is a dataclass with messages: tuple[Message, ...], conversation_ids: tuple[str, ...], and my_post_key.
Every state-changing call in the SDK auto-fetches its own my_post_key and form hidden fields when you don't pass them. To skip the extra round-trip, pass them explicitly:
await client.messages.send(
to = 'recipient',
message = 'hello',
my_post_key = inbox.my_post_key,
)
Read the feed
for thread in await client.feed.explore():
print(thread.title, thread.link, thread.tid)
for thread in await client.feed.home():
print(thread.title, thread.tid)
feed.explore() and feed.home() return list[ThreadSummary] with title, link, and tid (numeric, or None for slug-rewritten URLs that don't carry one). For raw HTML access, use get_explore() / get_home().
Reply to a thread
await client.threads.reply(tid, message = 'great post')
Persist a session
ogu-api doesn't store credentials. After login, the session lives on the client's cookie jar — serialize it however you like:
cookies = {cookie.name: cookie.value for cookie in client.cookies}
To resume a session, pre-seed the cookies on a fresh client:
client = OGUClient()
for name, value in cookies.items():
client.cookies.set(name, value)
Configuration
client = OGUClient(
proxy = 'user:pass@host:8080',
timeout_seconds = 30.0,
max_retries = 3,
retry_backoff_seconds = 0.5,
client_identifier = 'chrome131',
)
Proxy strings accept user:pass@host:port, host:port:user:pass, or plain host:port and are normalized to http://... for the underlying tls_client session.
Errors
from ogu_api import OGUNotFoundError, OGURateLimitError
try:
await client.users.get_by_username('does-not-exist')
except OGUNotFoundError as E:
print('not found:', E.url)
except OGURateLimitError as E:
print('rate limited, retry after', E.retry_after_seconds)
Full hierarchy:
OGUErrorOGUAPIError—OGUAuthenticationError,OGUAuthorizationError,OGUNotFoundError,OGUValidationError,OGURateLimitError,OGUServerErrorOGUNetworkError—OGUTimeoutErrorOGUParseError,OGUSessionError,OGULoginError,OGUReputationError,OGUCreditsError
Captcha
Sending credits requires an hCaptcha token. ogu-api doesn't ship a solver — pass a pre-solved token in:
await client.credits.send(
username = 'recipient',
amount = 100,
captcha_token = solved_token,
)
Features
- Async-first — every request is
async, backed bytls_clienton a worker thread for Cloudflare-friendly TLS fingerprints - Typed —
from __future__ import annotationseverywhere,py.typedmarker, dataclass models for parsed payloads - Resource-oriented — calls grouped under
client.session,client.users,client.messages, etc. - Typed errors — full exception hierarchy mapped from HTTP status codes
- Retries — exponential backoff on
429and5xx, honorsRetry-After - Proxies — string-form proxies auto-normalized
License
MIT
Metadata
Release files for ogu-api 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ogu_api-0.6.1.tar.gz | 26.6 kB | With provenance | Details for ogu_api-0.6.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ogu_api-0.6.1-py3-none-any.whl | Python 3 | none | any | Details for ogu_api-0.6.1-py3-none-any.whl |
Total release size: 64.3 kB
Release files / ogu_api-0.6.1.tar.gz
| Download URL | ogu_api-0.6.1.tar.gz |
|---|---|
| Size | 26.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
74b88f0c9ec5ec7cd32773b13496cd81d6501d8ee5af2c31969f67ce5fe40fea
|
|
BLAKE2b-256 checksum How to use checksums |
e64bc73875b60488353a2437c6510e4e4607497a154eb125a0c2b964fa8707d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 7, 2026.
Transparency logRelease files / ogu_api-0.6.1-py3-none-any.whl
| Download URL | ogu_api-0.6.1-py3-none-any.whl |
|---|---|
| Size | 37.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
632f302c81cf90e77409121a0e0c8ca4719a80516b40dd8a3b6df0a9ebf5a66b
|
|
BLAKE2b-256 checksum How to use checksums |
2f48c33218d2296a20eced881419f0d362c3af69bcff7ea70fb37e177917e9f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 7, 2026.
Transparency logSecurity for ogu-api 0.6.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for ogu_api-0.6.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 7, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.