skillfed

pydiscourse

"A Python library for the Discourse API"

pydiscourse v1.7.0 89.2K downloads/30d#13,676 on PyPI86
Permissive license "MIT" AGING released

What it is and what it does

pydiscourse is a Python wrapper around the Discourse forum API. It lets you programmatically create and manage users, topics, posts, groups, and other forum objects on a Discourse server. The library exposes Discourse's HTTP API as Python methods, so you can automate forum administration, integrate Discourse into your application, or build tools that interact with forum data.

The package is a maintained fork of an earlier version, with a focus on documentation and broad Python version support. It includes a command-line tool for experimenting with API calls and supports Discourse-specific features like SSO integration. The only runtime dependency is requests, making it lightweight to install.

Use it for:

  • Automate user creation and management on a Discourse forum from a Python application or admin script.
  • Integrate Discourse SSO (single sign-on) into your Python web application so users log in via your site.
  • Build a bot or tool that monitors forum activity, creates posts, or manages groups programmatically.
  • Query forum data (users, topics, posts) from Python to feed into analytics or reporting systems.
  • Migrate or synchronize user data between Discourse and another system via the API.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A Python client library for the Discourse API that provides methods to interact with Discourse servers—managing users, topics, posts, groups, and other forum resources programmatically.

Yes, if you need to interact with Discourse from Python. The library is stable, has no known vulnerabilities, and depends only on requests. However, be aware that the last release was 850 days ago; if you need support for very recent Discourse API changes, verify compatibility first or check whether the repository has unreleased fixes on the main branch.

Install

pydiscourse on PyPI

pip

pip install pydiscourse

uv

uv add pydiscourse

poetry

poetry add pydiscourse

Installing pydiscourse

Before you install

Low install friction; depends only on requests. Maintenance status is aging—last release was 850 days ago (April 2024), though the repository remains active with a recent commit in February 2025. No known vulnerabilities.

License in practice

MIT license is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

Quickstart

pip install pydiscourse

from pydiscourse import DiscourseClient
client = DiscourseClient(
    'http://example.com',
    api_username='username',
    api_key='your_api_key')
user = client.user('username')

Verify before relying

  • Current Discourse API version compatibility—the fact sheet notes the Discourse API is a moving target but does not specify which versions are supported by 1.7.0.
  • Whether Python support is truly unspecified or if there is a practical minimum version given the codebase history (Python 2.7 dropped in 1.2.0, but requires_python is null).

Package facts

License "MIT" (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — requests
Maintenance aging — 850 days since the last release
Last repo commit
First released
Downloads 89,172/month — #13,676 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pydiscourse-1.7.0-py2.py3-none-any.whl

Tags

discourse api clientdiscourse python libraryforum api integrationdiscourse ssodiscourse user managementdiscourse automationdiscourse api wrapper
api-clientforum-integration

More WWW/HTTP packages