Skip to content

Users

This subclient handle all the user related interaction with the Eternaltwin API.

eternaltwin.clients.abc.users.UserClientABC

UserClientABC(client: C)

Bases: NamespacedClientABC[C], Generic[C]

Base class for sub-client handling interaction with users.

me abstractmethod

me(token: Token = None) -> Response | Awaitable[Response]

Retrieve currently authenticated user's profile.

get abstractmethod

get(user_id: str, token: Token = None) -> Response | Awaitable[Response]

Retrieve a user using their ID.

search abstractmethod

search(query: str = None, limit: int = 20, offset: int = 0, token: Token = None) -> Response | Awaitable[Response]

Search for users matching the query.

Parameters:

Name Type Description Default
query str

An optional query to use against the user's username, default to None.

None
limit int

The maximum number of users to return, default to 20.

20
offset int

The offset to start returning users from, default to 0.

0

eternaltwin.clients.sync.users.UserClient

UserClient(client: C)

Bases: UserClientABC

Synchronous implementation of UserClientABC using requests.

eternaltwin.clients.sync.users.UserClient.me

me(token: Token = None) -> Response

Retrieve currently authenticated user's profile.

eternaltwin.clients.sync.users.UserClient.get

get(user_id: str, token: Token = None) -> Response

Retrieve a user using their ID.

eternaltwin.clients.sync.users.UserClient.search

search(query: str = None, limit: int = 20, offset: int = 0, token: Token = None) -> Response

Search for users matching the query.

Parameters:

Name Type Description Default
query str

An optional query to use against the user's username, default to None.

None
limit int

The maximum number of users to return, default to 20.

20
offset int

The offset to start returning users from, default to 0.

0

eternaltwin.clients.asyncio.users.UserClient

UserClient(client: C)

Bases: UserClientABC

Synchronous implementation of UserClientABC using requests.

eternaltwin.clients.asyncio.users.UserClient.me async

me(token: Token = None) -> Response

Retrieve currently authenticated user's profile.

eternaltwin.clients.asyncio.users.UserClient.get async

get(user_id: str, token: Token = None) -> Response

Retrieve a user using their ID.

eternaltwin.clients.asyncio.users.UserClient.search async

search(query: str = None, limit: int = 20, offset: int = 0, token: Token = None) -> Response

Search for users matching the query.

Parameters:

Name Type Description Default
query str

An optional query to use against the user's username, default to None.

None
limit int

The maximum number of users to return, default to 20.

20
offset int

The offset to start returning users from, default to 0.

0