18 lines
430 B
Python
18 lines
430 B
Python
|
from lunduke.client import DiscourseClient
|
||
|
|
||
|
|
||
|
def main():
|
||
|
|
||
|
client = DiscourseClient()
|
||
|
try:
|
||
|
response = client.get('/categories.json')
|
||
|
categories = response.json()['category_list']['categories']
|
||
|
for cat_dict in categories:
|
||
|
for key,val in cat_dict.items():
|
||
|
print(key, ": ", val)
|
||
|
except Exception as e:
|
||
|
print(f"Error: {e}")
|
||
|
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
main()
|