oldas.session
Provides a class for getting and managing a login session.
Session
Class for handling a TheOldReader login session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The name of the client that is logging in. |
required |
|
str | None
|
Optional authorization code to resume a session. |
None
|
|
int
|
The timeout in seconds to use when making calls. |
60
|
Note
The client should be a unique name you give your client
application that is using this library.
auth_code
property
auth_code
The auth code, if we are logged in, else None.
logged_in
property
logged_in
Are we logged in?
add_tag
async
get
async
get(url, **params)
Make a GET call to the API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The URL to call. |
required |
|
Any
|
Any extra parameters that need to be passed. |
{}
|
Returns:
| Type | Description |
|---|---|
RawData
|
A dictionary that is the JSON data. |
Raises:
| Type | Description |
|---|---|
OldASError
|
If there was an error connecting or logging in. |
login
async
Log into TheOldReader.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The user name to log in with. |
required |
|
str
|
The password to log in with. |
required |
Returns:
| Type | Description |
|---|---|
Self
|
Self. |
Raises:
| Type | Description |
|---|---|
OldASError
|
If there was an error connecting or logging in. |
logout
logout()
Log out of the TheOldReader.
post
async
post(url, **data)
Make a POST call to the API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The URL to call. |
required |
|
Any
|
The data to pass. |
{}
|
Returns:
| Type | Description |
|---|---|
bool
|
The boolean response from the API. |
Raises:
| Type | Description |
|---|---|
OldASError
|
If there was an error connecting or logging in. |