session
numerous.session
Package for managing user sessions and cookie-based authentication.
Session
A session with Numerous.
Source code in numerous/session/session.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
cookies: dict[str, str]
property
The cookies associated with the current session.
user: User
property
The user associated with the current session.
User
dataclass
Represents a Numerous platform user.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
The unique identifier for the user. |
name |
str
|
The full name of the user. |
email |
str | None
|
The email of the user. |
Source code in numerous/session/user.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
collection: CollectionReference
property
A user's collection.
A collection scoped for the current user. It is a child-collection of the root collection with the key "users", and has the user's ID as key.
Equivalent to:
collection("users").collection(user.id)
Returns:
| Type | Description |
|---|---|
CollectionReference
|
The collection for this user. |
from_user_info(user_info, _client=None)
staticmethod
Create a User instance from a dictionary of user information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_info
|
dict[str, Any]
|
A dictionary containing user information. |
required |
Returns:
| Type | Description |
|---|---|
User
|
A new User instance created from the provided information. |
Source code in numerous/session/user.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |