lunduke-cli/examples/get_user.py

18 lines
378 B
Python
Raw Permalink Normal View History

from config.configuration import Config
from lunduke.client import DiscourseClient
def main():
user = Config().username
client = DiscourseClient()
try:
response = client.get(f"/u/{user}.json")
print(response.status_code)
print(response.json())
except Exception as e:
print(f"Error: {e}")
if __name__ == "__main__":
main()