enconnect.reddit package#

Submodules#

enconnect.reddit.models module#

class enconnect.reddit.models.RedditListing[source]#

Bases: BaseModel

Contains information returned from the upstream response.

Fields#

Field

Type

Required

Default

archived

bool

Yes

author

str

Yes

created

int

Yes

domain

str

Yes

edited

bool | float

Yes

id

str

Yes

medias

list[str] | None

No

None

name

str

Yes

permalink

str

Yes

pinned

bool

Yes

score

int

Yes

selftext

str | None

No

None

stickied

bool

Yes

thumbnail

str

Yes

title

str

Yes

url

str

Yes

url_dest

str | None

No

None

vote_downs

int

Yes

vote_ups

int

Yes

name: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
id: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
created: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
title: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
selftext: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')]#
author: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
url: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
thumbnail: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
url_dest: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')]#
domain: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
medias: Annotated[list[str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')]#
pinned: Annotated[bool, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
edited: Annotated[bool | float, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
stickied: Annotated[bool, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
archived: Annotated[bool, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
vote_downs: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
vote_ups: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
score: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#

enconnect.reddit.params module#

class enconnect.reddit.params.RedditParams[source]#

Bases: BaseModel

Process and validate the class configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

client

str

Yes

min_length=1

password

str

Yes

min_length=1

secret

str

Yes

min_length=1

ssl_capem

str | None

No

None

min_length=1

ssl_verify

bool

No

True

timeout

int

No

30

ge=1, le=300

useragent

str

Yes

min_length=1

username

str

Yes

min_length=1

timeout: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=30, description='Timeout connecting to server', metadata=[Ge(ge=1), Le(le=300)])]#
username: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
password: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
client: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
secret: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
useragent: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
ssl_verify: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=True, description='Verify the ceritifcate valid')]#
ssl_capem: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Verify the ceritifcate valid', metadata=[MinLen(min_length=1)])]#

enconnect.reddit.reddit module#

class enconnect.reddit.reddit.Reddit(params: RedditParams)[source]#

Bases: object

Interact with the cloud service API with various methods.

Parameters:

params – Parameters used to instantiate the class.

property params: RedditParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property client: HTTPClient#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property token: str | None#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

request_token_block() str[source]#

Establish new session obtaining token for authorization.

Returns:

Access token used with authenticated requests.

async request_token_async() str[source]#

Establish new session obtaining token for authorization.

Returns:

Access token used with authenticated requests.

request_block(method: Literal['get', 'post'], path: str, params: dict[str, Any] | None = None, data: dict[str, Any] | None = None, *, httpauth: tuple[str, str] | None = None) Response[source]#

Return the response for upstream request to the server.

Parameters:
  • method – Method for operation with the API server.

  • path – Path for the location to upstream endpoint.

  • params – Optional parameters included in request.

  • data – Optional dict payload included in request.

  • httpauth – Optional information for authentication.

Returns:

Response from upstream request to the server.

async request_async(method: Literal['get', 'post'], path: str, params: dict[str, Any] | None = None, data: dict[str, Any] | None = None, *, httpauth: tuple[str, str] | None = None) Response[source]#

Return the response for upstream request to the server.

Parameters:
  • method – Method for operation with the API server.

  • path – Path for the location to upstream endpoint.

  • params – Optional parameters included in request.

  • data – Optional dict payload included in request.

  • httpauth – Optional information for authentication.

Returns:

Response from upstream request to the server.

listing(unique: str) RedditListing[source]#

Return the specific content within the social platform.

Parameters:

unique – Unique identifier within social platform.

Returns:

Specific content within the social platform.

listing_block(unique: str) RedditListing[source]#

Return the specific content within the social platform.

Parameters:

unique – Unique identifier within social platform.

Returns:

Specific content within the social platform.

async listing_async(unique: str) RedditListing[source]#

Return the specific content within the social platform.

Parameters:

unique – Unique identifier within social platform.

Returns:

Specific content within the social platform.

latest(subred: str, params: dict[str, Any] | None = None) list[RedditListing][source]#

Return the new items within the provided subreddit path.

Parameters:
  • subred – Path to subreddit containing the content.

  • params – Optional parameters included in request.

Returns:

New items within the provided subreddit path.

latest_block(subred: str, params: dict[str, Any] | None = None) list[RedditListing][source]#

Return the new items within the provided subreddit path.

Parameters:
  • subred – Path to subreddit containing the content.

  • params – Optional parameters included in request.

Returns:

New items within the provided subreddit path.

async latest_async(subred: str, params: dict[str, Any] | None = None) list[RedditListing][source]#

Return the new items within the provided subreddit path.

Parameters:
  • subred – Path to subreddit containing the content.

  • params – Optional parameters included in request.

Returns:

New items within the provided subreddit path.

Module contents#

class enconnect.reddit.Reddit(params: RedditParams)[source]#

Bases: object

Interact with the cloud service API with various methods.

Parameters:

params – Parameters used to instantiate the class.

property params: RedditParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property client: HTTPClient#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property token: str | None#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

request_token_block() str[source]#

Establish new session obtaining token for authorization.

Returns:

Access token used with authenticated requests.

async request_token_async() str[source]#

Establish new session obtaining token for authorization.

Returns:

Access token used with authenticated requests.

request_block(method: Literal['get', 'post'], path: str, params: dict[str, Any] | None = None, data: dict[str, Any] | None = None, *, httpauth: tuple[str, str] | None = None) Response[source]#

Return the response for upstream request to the server.

Parameters:
  • method – Method for operation with the API server.

  • path – Path for the location to upstream endpoint.

  • params – Optional parameters included in request.

  • data – Optional dict payload included in request.

  • httpauth – Optional information for authentication.

Returns:

Response from upstream request to the server.

async request_async(method: Literal['get', 'post'], path: str, params: dict[str, Any] | None = None, data: dict[str, Any] | None = None, *, httpauth: tuple[str, str] | None = None) Response[source]#

Return the response for upstream request to the server.

Parameters:
  • method – Method for operation with the API server.

  • path – Path for the location to upstream endpoint.

  • params – Optional parameters included in request.

  • data – Optional dict payload included in request.

  • httpauth – Optional information for authentication.

Returns:

Response from upstream request to the server.

listing(unique: str) RedditListing[source]#

Return the specific content within the social platform.

Parameters:

unique – Unique identifier within social platform.

Returns:

Specific content within the social platform.

listing_block(unique: str) RedditListing[source]#

Return the specific content within the social platform.

Parameters:

unique – Unique identifier within social platform.

Returns:

Specific content within the social platform.

async listing_async(unique: str) RedditListing[source]#

Return the specific content within the social platform.

Parameters:

unique – Unique identifier within social platform.

Returns:

Specific content within the social platform.

latest(subred: str, params: dict[str, Any] | None = None) list[RedditListing][source]#

Return the new items within the provided subreddit path.

Parameters:
  • subred – Path to subreddit containing the content.

  • params – Optional parameters included in request.

Returns:

New items within the provided subreddit path.

latest_block(subred: str, params: dict[str, Any] | None = None) list[RedditListing][source]#

Return the new items within the provided subreddit path.

Parameters:
  • subred – Path to subreddit containing the content.

  • params – Optional parameters included in request.

Returns:

New items within the provided subreddit path.

async latest_async(subred: str, params: dict[str, Any] | None = None) list[RedditListing][source]#

Return the new items within the provided subreddit path.

Parameters:
  • subred – Path to subreddit containing the content.

  • params – Optional parameters included in request.

Returns:

New items within the provided subreddit path.

class enconnect.reddit.RedditParams[source]#

Bases: BaseModel

Process and validate the class configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

client

str

Yes

min_length=1

password

str

Yes

min_length=1

secret

str

Yes

min_length=1

ssl_capem

str | None

No

None

min_length=1

ssl_verify

bool

No

True

timeout

int

No

30

ge=1, le=300

useragent

str

Yes

min_length=1

username

str

Yes

min_length=1

timeout: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=30, description='Timeout connecting to server', metadata=[Ge(ge=1), Le(le=300)])]#
username: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
password: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
client: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
secret: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
useragent: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
ssl_verify: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=True, description='Verify the ceritifcate valid')]#
ssl_capem: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Verify the ceritifcate valid', metadata=[MinLen(min_length=1)])]#
class enconnect.reddit.RedditListing[source]#

Bases: BaseModel

Contains information returned from the upstream response.

Fields#

Field

Type

Required

Default

archived

bool

Yes

author

str

Yes

created

int

Yes

domain

str

Yes

edited

bool | float

Yes

id

str

Yes

medias

list[str] | None

No

None

name

str

Yes

permalink

str

Yes

pinned

bool

Yes

score

int

Yes

selftext

str | None

No

None

stickied

bool

Yes

thumbnail

str

Yes

title

str

Yes

url

str

Yes

url_dest

str | None

No

None

vote_downs

int

Yes

vote_ups

int

Yes

name: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
id: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
created: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
title: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
selftext: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')]#
author: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
url: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
thumbnail: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
url_dest: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')]#
domain: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
medias: Annotated[list[str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')]#
pinned: Annotated[bool, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
edited: Annotated[bool | float, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
stickied: Annotated[bool, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
archived: Annotated[bool, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
vote_downs: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
vote_ups: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
score: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#