From 7485bb63466f17febe2e165940bdc6d70e2e715f Mon Sep 17 00:00:00 2001 From: neodarz Date: Sun, 12 Apr 2020 11:14:01 +0200 Subject: Add endpoint for retrieve current user information --- README.md | 2 +- pyfunkwhale/funkwhale.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d9fb025..82dd441 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ List of features implemented or planned: - [x] Get an JWT token - [ ] Create an account - [ ] Request a password request - - [ ] Retrieve user information + - [x] Retrieve user information - [ ] Retrieve rate-limit information and current usage status - [x] Artists - [x] List artists diff --git a/pyfunkwhale/funkwhale.py b/pyfunkwhale/funkwhale.py index 02b76f2..1f8257b 100644 --- a/pyfunkwhale/funkwhale.py +++ b/pyfunkwhale/funkwhale.py @@ -55,6 +55,13 @@ class Funkwhale(object): return self.client.call('/oauth/apps/', 'post', data=datas).json() + def user_me(self): + """ + Retrieve profile informations of the current user + """ + + return self.client.call('/users/users/me', 'get').json() + def artists(self, q: str = None, ordering: str = None, playable: bool = None, page: int = None, page_size: int = None) -> dict: -- cgit v1.2.1