{"id":24317,"library":"pydiscourse","title":"pydiscourse","description":"A Python client library for the Discourse API. Allows interacting with a Discourse forum programmatically: create topics, posts, users, groups, etc. Latest version 1.7.0 adds Python 3.12 support. Maintenance ongoing, releases are sporadic.","status":"active","version":"1.7.0","language":"python","source_language":"en","source_url":"https://github.com/bennylope/pydiscourse","tags":["discourse","api","client","forum"],"install":[{"cmd":"pip install pydiscourse","lang":"bash","label":"pip"}],"dependencies":[{"reason":"HTTP client for Discourse API calls","package":"requests","optional":false}],"imports":[{"note":"","wrong":null,"symbol":"DiscourseClient","correct":"from pydiscourse import DiscourseClient"},{"note":"DiscourseError is in pydiscourse.exceptions, not top-level.","wrong":"from pydiscourse import DiscourseError","symbol":"DiscourseError","correct":"from pydiscourse.exceptions import DiscourseError"}],"quickstart":{"code":"import os\nfrom pydiscourse import DiscourseClient\n\nclient = DiscourseClient(\n    host=os.environ.get('DISCOURSE_HOST', 'https://forum.example.com'),\n    api_username=os.environ.get('DISCOURSE_API_USER', 'system'),\n    api_key=os.environ.get('DISCOURSE_API_KEY', '')\n)\n# Get latest topics\nlatest = client.latest_topics()\nprint(latest[:2])","lang":"python","description":"Initialize client with environment variables and fetch latest topics."},"warnings":[{"fix":"Always pass host, api_username, api_key as keyword arguments.","message":"The constructor expects `api_username` and `api_key` as keyword arguments; positional usage was common before v1.6.0 and may break if arguments are passed positionally.","severity":"gotcha","affected_versions":">=1.6.0"},{"fix":"Use Python 3.8+ (3.12 recommended).","message":"Python 2.7, 3.4, 3.5 support dropped in v1.2.0. Python 3.7 dropped in v1.5.0.","severity":"deprecated","affected_versions":">=1.2.0"},{"fix":"pip install requests","message":"The `requests` library is required and must be installed separately if not automatically pulled.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use from pydiscourse.exceptions import DiscourseError","cause":"DiscourseError is not exported from the top-level package.","error":"ImportError: cannot import name 'DiscourseError' from 'pydiscourse'"},{"fix":"Use DiscourseClient(host='...', api_username='...', api_key='...')","cause":"Passing host, api_username, api_key as positional arguments instead of keyword arguments.","error":"TypeError: __init__() takes 1 positional argument but 3 were given"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}