User
Commands related to registered users.
- async flightplandb.user.me(key: str | None = None) User
Fetches profile information for the currently authenticated user.
Requires authentication.
- Parameters:
key (str, optional) -- API authentication key.
- Returns:
The User object of the currently authenticated user
- Return type:
- Raises:
UnauthorizedException -- Authentication failed.
- async flightplandb.user.fetch(username: str, key: str | None = None) User
Fetches profile information for any registered user
- Parameters:
username (str) -- Username of the registered User
key (str, optional) -- API authentication key.
- Returns:
The User object of the user associated with the username
- Return type:
- Raises:
NotFoundException -- No user was found with this username.
- async flightplandb.user.plans(username: str, sort: str = 'created', limit: int = 100, key: str | None = None) AsyncIterable[Plan]
Fetches flight plans created by a user.
- Parameters:
username (str) -- Username of the user who created the flight plans
sort (str) -- Sort order to return results in. Valid sort orders are created, updated, popularity, and distance
limit (int) -- Maximum number of plans to fetch, defaults to
100
key (str, optional) -- API authentication key.
- Yields:
AsyncIterable[Plan] -- An iterator with all the flight plans a user created, limited by
limit
- async flightplandb.user.likes(username: str, sort: str = 'created', limit: int = 100, key: str | None = None) AsyncIterable[Plan]
Fetches flight plans liked by a user.
- Parameters:
username (str) -- Username of the user who liked the flight plans
sort (str) -- Sort order to return results in. Valid sort orders are created, updated, popularity, and distance
limit (int) -- Maximum number of plans to fetch, defaults to
100
key (str, optional) -- API authentication key.
- Yields:
AsyncIterable[Plan] -- An iterable with all the flight plans a user liked, limited by
limit
- async flightplandb.user.search(username: str, limit=100, key: str | None = None) AsyncIterable[UserSmall]
Searches for users by username. For more detailed info on a specific user, use
fetch()
- Parameters:
username (str) -- Username to search user database for
limit (type) -- Maximum number of users to fetch, defaults to
100
key (str, optional) -- API authentication key.
- Yields:
AsyncIterable[UserSmall] -- An iterable with a list of users approximately matching
username
, limited bylimit
. UserSmall is used instead of User, because less info is returned.