an api client for the lunduke discourse
Go to file
2025-04-12 23:56:34 +01:00
config add readme, fix poetry configuration, tidy up 2025-04-12 20:03:46 +01:00
examples work on more examples 2025-04-12 23:56:34 +01:00
lunduke work on more examples 2025-04-12 23:56:34 +01:00
scripts a proper project@ 2025-04-11 22:46:02 +01:00
.gitignore implement toml config 2025-04-12 18:16:27 +01:00
pyproject.toml add readme, fix poetry configuration, tidy up 2025-04-12 20:03:46 +01:00
README.md add readme, fix poetry configuration, tidy up 2025-04-12 20:03:46 +01:00

lunduke-cli

A simple python api client for discourse, designed explicitly for the lunduke discourse message board, but it could be used with any discourse message board.

Requirements

  • Python 3.12 (or better)
  • Poetry 2.0 (or better)

Poetry's pyproject.toml handles all other requirements.

Initialization

$ poetry install

Usage

See the "examples" directory. However, there are some additional notes you will need, in order to make it work.

First, a keys directory at the root of the project, where you will store a user api key you have already generated. A well formed api key should look something like this:

X4ktxE5tsvC+RcvjF9Pa1N//PWTgjAF1xx5UcuaHFVKu84A14n6stDheUxxx
xxx8xxxUbpVN3xOtDxxIg5sU4ZjAZ+LRyKxU9+ikQMqno4Spqb9SOrclxxxx
5Lo/6xkBB/xM9/Rxxx3I0ZAcvurYeIHkVQmSigmaPMJBjx/MKLMGdlVOq+is
mxu7qTQcl85E5k0MC86LNr5Ds4xUQXgIGVGVICxxxUMr2VxxxD9tglgG+9sL
VYFehH4HxxPxx67XRfrq8WxZjYRMHcWaGO4O03lQZwPEpIz7aL6D6wPNdCaq
nH9ivM/3MdEUOQZQuh8R+XJ9Ik7RlTLNVxx8bxTJ2X==

Second, you will need a file called config.toml in the root of the project. That file should look like this:

[user]
username = "joe-doakes"

[api]
key_file = "cli_key.txt"
host = "forum.wherever.com"

Then, you can run the test scripts either with or without poetry support:

$ poetry run python examples/check-key.py # for example

$ python examples/example.py # for example