Users
Methods for searching and retrieving users.
UserClient
- class muckrock.users.UserClient
The user client allows access to search, list, and retrieve individual users. Accessed generally as
client.users.>>> my_user = client.users.me()
- me(self)
Retrieve the currently authenticated user.
- Returns:
A
Userobject representing the authenticated user.
- list(self, **params)
List all users with optional filtering. Available filters include:
id: Filter by the unique identifier of the user.
full_name: Filter by the full name of the user.
username: Filter by the username of the user.
uuid: Filter by the unique identifier for the user’s profile.
email: Filter by the user’s email address.
- Parameters:
params – Query parameters to filter results, such as id, full_name, username, uuid, and email.
- Returns:
An
APIResultsobject containing the list of users.
- retrieve(self, user_id)
Retrieve a specific user by their ID
- Parameters:
user_id – The unique ID of the user to retrieve.
- Returns:
A
Userobject representing the requested user.
User
- class muckrock.users.User
A representation of a single user.
- str()
Return a string representation of the user in format: User {id} - Username: {username}, Email: {email}.
- id
The unique numerical identifier for the user.
- username
The unique username of the user.
- email
The email address of the user.
- last_login
The date and time when the user last logged in.
- date_joined
The date and time when the user joined.
- full_name
The full name of the user.
- uuid
The unique identifier for the user’s profile (UUID format).
- organizations
A list of organization IDs the user belongs to.